-
Notifications
You must be signed in to change notification settings - Fork 191
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
Referring object tamper other objects through referenced one #2419
Comments
Here's another example of the problem:
openapi: 3.1.0
info:
title: Test
version: version
paths:
/operation:
post:
requestBody:
content:
application/json:
schema:
type: object
properties:
AAAAA:
$ref: 'referenced.yaml'
description: AAAAA
examples:
- AAAAA
BBBBB:
$ref: 'referenced.yaml'
# If description is commented out, it's displayed as AAAAA
description: BBBBB
# Example is displayed as AAAAA
examples:
- BBBBB
In this example the response body is inline rather than ref'ed and does not include the |
@vZ2JEZsZW I am currently troubleshooting this and had a question: were you using elements dev portal when encountering this issue? |
I believe it's "stoplight elements" and in my case the spec was split in several files so was the minimal reproducible example I extracted. What follows is an html page which exhibits described behavior. page.html
Yamls are same files from original post repeated for completeness. file1.yaml
file2.yaml
|
@vZ2JEZsZW I have merged in a fix for this issue and the fix is available in elements version While I was working on this fix, I realized that part of the issue you are experiencing is due to having invalid reference siblings. As of oas 3.1.0 the only fields allowed in a reference object are
|
That's good to hear you fixed this!
I will take that into account, thank you. |
description
andexamples
of referring objects discarded in favor of values spreading from other objects referring same target.Steps to Reproduce:
Resulting documentation:
![stoplight](https://private-user-images.githubusercontent.com/7002789/271508697-a9330175-5457-405c-a721-805dcaaee217.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI0MjQwNTcsIm5iZiI6MTcyMjQyMzc1NywicGF0aCI6Ii83MDAyNzg5LzI3MTUwODY5Ny1hOTMzMDE3NS01NDU3LTQwNWMtYTcyMS04MDVkY2FhZWUyMTcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDczMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MzFUMTEwMjM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTdhOGRhZjRkMzc5OWUwNjc2MzhmODg3MmI2MWIyYmI2ODk0NmVlMWY2MTFjNzQzZGIzMjMzMjA5OGM0MDQ4OCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Wh3rDtd4kxSGNzqW4g3psH75GuIrnMxe0EGfW9fbbTY)
BBBBB
gets irrelevant description and examples fromAAAAA
Version used: 7.13.1
The text was updated successfully, but these errors were encountered: