Feature request: Add an swagger extension to support xml tag with attributes and value
See original GitHub issueSwagger specifications (both 2.0 and 3.0) don’t support xml tags that have both an attribute and a value. For instance, this tag of ServiceBus Namespace API:
<title type="text">the title</title>
There is an open api issue: https://github.com/OAI/OpenAPI-Specification/issues/630.
Is it possible to have an extension in swagger file so autorest can generate the correct model class and msrest can serialize/deserialize?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Representing XML - Swagger
OAS 3 This guide is for OpenAPI 3.0. Representing XML. In your API specification, you can describe data in both XML and JSON...
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >OpenAPI Extensions - Swagger
Many API-related products that support OpenAPI make use of extensions to document their own attributes, such as Amazon API Gateway, ReDoc, APIMatic and ......
Read more >Describing Parameters - Swagger
Query parameters can be primitive values, arrays and objects. OpenAPI 3.0 provides several ways to serialize objects and arrays in the query string....
Read more >Customizing your auto-generated Swagger Definitions in 1.5.x
The @SwaggerDefinition annotation is the single biggest addition to the core annotations; it provides you a means to add definition-level ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is available in AutoRest Core
3.0.6290
, it’s a dev release so you’ll have to reference it directly when running AutoRest (--version:3.0.6290
) to try it. I’ll ship a regular update to AutoRest Core once I figure out what broke regression tests recently.@lmazuel spoke about this over Teams, we think a good approach for now is to use an extension to indicate when a property should be treated as the text body of an XML element. Here’s an example:
Swagger input:
CodeModel output:
AutoRest passes the
x-xml-text
extension straight through to the CodeModel (it ends up under thexml.extensions
sub-object) so the Python generator should be able to pick that up and use it to map the XML appropriately. Once the OpenAPI folks standardize on an approach we can add official support for it in AutoRest.