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,101
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

@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.

Hi @Anil Sagar (asagar@apigee.com),

Thank you for your help. By the line - "I don't think Apigee Smartdocs supports XML sample request / response rendering as of today." do you mean that the smart docs in dev portal will not be able to accommodate the spec that contains xmlObject in schema definition?

Regards,

Santosh

Hi @Anil Sagar ,

Can you please help and clarify above doubt about support for this by smartdocs.

Thanks,

Santosh

@santosh_ghalsasi , It does work, but you will not see sample request schema as far as i know. API interaction should work. Hope it helps.

@Anil Sagar @ Google Is it possible with new apigee integrated OOTB Dev Portal?