Forum Discussion
ReignCreed
2 years agoOccasional Visitor
To resolve the issue you're facing with rendering in Swagger for your XML implementation of the OpenAPI 3.0 solution, you can make the following adjustments to your schema:
Header: type: object properties: Fluss: type: object properties: "#text": type: string xml: wrapped: true Index: type: string xml: attribute: true example: "4"
Explanation:
- The <Header> element remains the same.
- The <Fluss> element is represented by the Fluss property within the Header object. It is defined as an object type with a single property #text to represent the text value of the element.
- The xml property under Fluss is set to wrapped: true, indicating that the Fluss element should be wrapped within the Header element.
- The Index attribute is represented as a separate property outside of the Fluss object, directly under Header. It is defined as a string type and uses the xml property with attribute: true to indicate that it should be rendered as an attribute in the XML.
With these adjustments, you should be able to render the desired XML structure in Swagger without encountering any errors.
Related Content
- 4 years ago
- 5 years ago
- 5 years ago
Recent Discussions
- 4 months ago
- 4 months ago
- 6 months ago
- 10 months ago