Duplicate component schemes workaround. But the new duplicates simply reference ($ref) to already existing ones #846
ValdemarBirkegaardPetersen
started this conversation in
General
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
'm trying to merge several OpenAPI specs into a single OpenAPI document. However, some of the OpenAPI specs that im trying to merge, contains Components.Schemes with identical key names but different values/schemes. My initial solution was to check if a key already exists, and if it does, i simply change the key name to "KeyName2","KeyName3", and so on. This is the current code:
When im serializing the merged OpenAPI spec, the new keys exists as expected, but the values of the new keys are simply references to the previous identical key, even though the value/content of the scheme is different.
Output from the merged OpenAPI document is below:
As you can see, the ProblemDetails2 and Subscription2 is created with a reference ($ref) to the schemes that alreay have been added to the final document. Even though some of the schemes have identical names, their content and structure is very different. How do i fix this issue? I know there is function called SerializeAsV3WithoutReferences, but thats really my only idea. Can anyone point me in the right direction?
Beta Was this translation helpful? Give feedback.
All reactions