Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added YAML Support to Examples #185

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

adam8797
Copy link

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
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
Copy link
Author

adam8797 commented Aug 2, 2021

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