Closed Jakousa closed 2 months ago
Might be related.
Edit: I did a quick check according to the response to this issue
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 $ref
for the same purpose.
Closing this as there is nothing I can do to fix it. But it's good to document known behavior.
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.