Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can we add XML schema definitions to swagger spec

Hi,

Edge API proxies support XML payloads in requests and responses. I wanted to know if there is a provision to give XML schema for these types of payloads in the swagger spec that we create for such API proxies. I know that we can do it for JSON but have not come across any spec that has XML schema mentioned in the definitions and that can help a developer to understand the request and response schema. Any help here will be really appreciated.

Thanks,

Santosh

Solved Solved
1 5 9,353
1 ACCEPTED SOLUTION

@santosh_ghalsasi Great Question !

Yes, You can do that. You can add xml schema definitions to OpenAPI (Swagger) Spec. See sample spec here, https://api.myjson.com/bins/10k6cr

See it in action using swagger UI here, http://petstore.swagger.io/

4593-screen-shot-2017-04-05-at-62612-pm.png

Find spec details here in OpenAPI spec documentation in github. It also has few examples.

Just FYI, I don't think Apigee Smartdocs supports XML sample request / response rendering as of today.

View solution in original post

5 REPLIES 5