Skip to content

Added YAML Support to Examples#185

Open
adam8797 wants to merge 4 commits into
mattfrear:masterfrom
adam8797:master
Open

Added YAML Support to Examples#185
adam8797 wants to merge 4 commits into
mattfrear:masterfrom
adam8797:master

Conversation

@adam8797

Copy link
Copy Markdown

I've added support for sending back YAML examples if the application supports it.

I've also gone and encapsulated the logic around the individual formats, instead of checking the type in the rendering methods

One of the things that bugs me about this is that YAML is whitespace sensitive, and in order to actually get it to render properly in the document we have to render it as an OpenApiString and let the framework add newlines for us.

Existing tests pass, but I haven't added new tests or examples yet.

@mattfrear

Copy link
Copy Markdown
Owner

Looks good so far, nice one. I can't say I've ever seen an API which returned YAML so it seems like an edge case to need examples in YAML.

Could you add some tests?

@adam8797

adam8797 commented Aug 2, 2021

Copy link
Copy Markdown
Author

Sure thing. Just wanted to get a stamp of approval in the implementation code before I went and did the rest of that work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants