-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add compliant example sets to show expected behaviour #99
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,9 @@ | |||
# OpenAPI Overlay Compliant Sets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# OpenAPI Overlay Compliant Sets | |
# OpenAPI Overlay Compliance Tests |
Or similar, and rename the top-level folder accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "Tests" rather overstates what these are: more like working examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that a compliant implementation produces equivalent output for the two inputs, and that implementors are well advised including these triplets in their end-to-end tests.
I'd run Prettier on the YAML files to minimize these differences. |
x-info: | ||
x-overlay-applied: structured-overlay | ||
description: This is an added description | ||
post: &ref_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
post: &ref_0 | |
post: |
I would not expect/require an Overlay processor to do this kind of YAML magic, I'd rather expect that it simply merges this everywhere, especially since the post
operation may already exist and the Overlay would just add foo
next to existing properties.
There should also be JSON inputs. And some "mixed" inputs with OpenAPI JSON and Overlay YAML, and vice versa. Would the output format be determined by the format of the OpenAPI input? The spec doesn't tell. |
Fair enough. I don't think these are of a quality that we can publish for tests but from our conversation yesterday I thought we agreed that sharing whatever we had would be useful at this stage. Should I just close? |
Don't close, I think these are a good starting point. Even if they aren't complete yet, they are behavior that we expect from each implementation. |
These examples are taken from the test suite of https://github.com/lornajane/openapi-overlays-js (and with thanks to @MikeRalphson who helped with the tests originally!) to illustrate the expected outputs from applying particular Overlays to OpenAPI descriptions.
I think these examples could be improved/expanded, and I'm not sure if we should try to somehow standardise how whitespace/quotes work because they are most of the diff. Would it make sense to lint/format all the yaml? Advice welcome!