python yaml.dump bad indentation

This ticket suggests the current implementation correctly follows the spec: The “-”, “?” and “:” characters used to denote block collection entries are perceived by people to be part of the indentation. This is handled on a case-by-case basis by the relevant productions. On the same thread, there is also this code snippet (modified to … Read more

Controlling Yaml Serialization Order in Python

Took me a few hours of digging through PyYAML docs and tickets, but I eventually discovered this comment that lays out some proof-of-concept code for serializing an OrderedDict as a normal YAML map (but maintaining the order). e.g. applied to my original code, the solution looks something like: >>> import yaml >>> from collections import … Read more

oneOf in Swagger schema does not work

oneOf is supported in OpenAPI version 3 (openapi: 3.0.0), but not in Swagger version 2 (swagger: ‘2.0’). PaymentMethod: oneOf: – $ref: ‘#/components/schemas/NewPaymentMethod’ – $ref: ‘#/components/schemas/ExistPaymentMethod’ GitHub issue ref: https://github.com/OAI/OpenAPI-Specification/issues/333 For a list of changes in OpenAPI 3.0 compared to 2.0, see: https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/