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

Add compliant example sets to show expected behaviour #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lornajane
Copy link
Contributor

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!

@@ -0,0 +1,9 @@
# OpenAPI Overlay Compliant Sets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# OpenAPI Overlay Compliant Sets
# OpenAPI Overlay Compliance Tests

Or similar, and rename the top-level folder accordingly

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@ralfhandl
Copy link
Contributor

we should try to somehow standardise how whitespace/quotes work because they are most of the diff

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@ralfhandl
Copy link
Contributor

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.

@lornajane
Copy link
Contributor Author

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?

@ralfhandl
Copy link
Contributor

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.

@lornajane lornajane mentioned this pull request Nov 26, 2024
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