-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Q&A (please complete the following information)
- OS: Windows 10
- Browser: Microsoft Edge
- Version: 134
- Method of installation: web (editor-next.swagger.io)
- Swagger-Editor version: 5.0.0-alpha.136
- Swagger/OpenAPI version: OpenAPI 3.0/3.1
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.1.0
info:
title: Sample API
version: '0.1'
paths:
components:
schemas:
BasicErrorModel:
type: object
required:
- message
- code
properties:
message:
type: string
code:
type: integer
minimum: 100
maximum: 600
ExtendedErrorModel:
allOf: # Combines the BasicErrorModel and the inline model
- $ref: "#/components/schemas/BasicErrorModel"
- type: object
required:
- rootCause
properties:
rootCause:
type: string
Describe the bug you're encountering
Switching between OpenAPI 3.0 and 3.1 versions causes the allOf element to render improperly.
To reproduce...
Steps to reproduce the behavior:
- Open the Swagger Next editor, and paste the provided API definition. At this point the
ExtendedErrorModel
renders with a wrong type:
but fixes itself upon opening it, showing expected behavior.
- Keeping the model open, change the
3.1.0
in the first line to3.0.0
. - Change the
3.0.0
in the first line to3.1.0
again.
Expected behavior
The spec renders as it did in step 1. Instead, the ref is not rendered properly:
The model needs to be fully collapsed and re-opened to render properly.
Additional context or thoughts
While probably inconsequential, it is confusing - initially I thought the behavior of allOf
has changed for some reason.
SDAravind-ISG
Metadata
Metadata
Assignees
Labels
No labels