-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Merging with anchors is not functioning as expected #325
Labels
documentation
Improvements or additions to documentation
Comments
Edit: openapi: 3.0.0
operation: &operation
/test:
get:
summary: A get
operationId: a-get
responses:
"200":
description: Test
info:
title: Title
version: 1.0.0
description: Description
contact: Contact
servers:
- url: https://url
paths:
<<: *operation Output (I changed the code to output the description): │Start │
│2024/08/27 20:16:38 INFO Pathitem is pathItem="&{Tags:[] Summary:A get Description: ExternalDocs:<nil> OperationId:a-get Parameters:[] RequestBody:<nil> Responses:0x14000222540 Callbacks:<nil> Deprecated:<nil> Security:[] Serv│
│ers:[] Extensions:0x140000aa008 low:0x14000228008}" │
│Responses: Test │
│End I recommend avoiding using YAML anchors and embeds. The OAS provides the schema ability to use |
Closing this as there is nothing I can do to fix it. But it's good to document known behavior. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aliases / anchors do not behave correctly with libopenapi. Anchors replace the object completely, instead of merge as expected:
Example code:
Example yaml:
Output:
Expected something like:
Leads to nil responses object, even though the operation should be merged with the responses.
The text was updated successfully, but these errors were encountered: