Skip to content
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

OpenAPI 3.1: $ref as sibling to required not working #1773

Closed
madsodgaard opened this issue Oct 12, 2021 · 1 comment
Closed

OpenAPI 3.1: $ref as sibling to required not working #1773

madsodgaard opened this issue Oct 12, 2021 · 1 comment
Assignees

Comments

@madsodgaard
Copy link

madsodgaard commented Oct 12, 2021

Describe the bug
#1766 fixed the issue where description was not correctly overriden, when it was a sibling to $ref. However, it still does not work for required.

Also, it looks like the field is completely missing from the schema overview? (see screenshot)

Expected behavior
I expect the property field in the response to be required.

Minimal reproducible OpenAPI snippet(if possible)

openapi: 3.1.0
info:
  version: 1.0.0
  title: Example.com
paths:
  "/test":
    get:
      operationId: test
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Response"
components:
  schemas:
    Response:
      $ref: "#/components/schemas/Test"
      required:
        - field
    Test:
      type: object
      properties:
        field:
          type: string
          description: test

image

Additional context
Tested with openapi-cli v1.0.0-beta.63

@AlexVarchuk AlexVarchuk self-assigned this Nov 23, 2021
@AlexVarchuk
Copy link
Collaborator

@madsodgaard fixed. If you reproduce it again please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants