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

SwaggerEditor@next: oneOf must be a non-empty array of schemas #4317

Closed
Skeeve opened this issue Jul 25, 2023 · 3 comments
Closed

SwaggerEditor@next: oneOf must be a non-empty array of schemas #4317

Skeeve opened this issue Jul 25, 2023 · 3 comments

Comments

@Skeeve
Copy link

Skeeve commented Jul 25, 2023

Q&A (please complete the following information)

  • OS: macOS
  • Browser: Vivaldi
  • Version: 6.1.3035.100 (Stable channel) (x86_64)
  • Method of installation: docker, but also tried on https://editor-next.swagger.io
  • Swagger-Editor version: next-v5 I guess
  • Swagger/OpenAPI version: 3.0.3

Content & configuration

Please find my "stripped down" OpenAPI definition gere:

openapi: 3.0.3
info:
  title: Test
  version: "1.2.alpha2"
paths:
  /notifications:
    get:
      summary: Get the current active notifications per brand or sender
      responses:
        '200':
          description: 
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/notifications_sender"
                  - $ref: "#/components/schemas/brand_info"
                  - $ref: "#/components/schemas/just_a_number"
components:
  schemas:
    notifications_sender:
      type: object
      properties:
        amount:
          type: integer
        alert_status:
          type: string
          pattern: ^(OK|WARNING|ALARM)$
      required:
        - amount
        - alert_status
    brand_info:
      type: array
      items:
        type: object
        properties:
          amount:
            type: integer
          alert_status:
            type: string
            pattern: ^(OK|WARNING|ALARM)$
          brand:
            type: string
            minLength: 1
            maxLength: 255
        required:
          - amount
          - brand
    just_a_number:
      type: integer

Swagger-Editor configuration options:

Using it OOTB

?withCredentials=true

Describe the bug you're encountering

I get the error message:

Severity Line Code Message
! 14 10055 oneOf must be a non-empty array of schemas

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://editor-next.swagger.io
  2. Paste my example
  3. See error

Expected behavior

I cannot see what's wrong with my OpeAPI definition

@Skeeve
Copy link
Author

Skeeve commented Jul 25, 2023

P.S. Insomnia does not complain, neither does "ReDoc" in VSCode do.

@Skeeve
Copy link
Author

Skeeve commented Jul 25, 2023

Seems this is related to #4026

@char0n
Copy link
Member

char0n commented Jul 26, 2023

Yes, this is duplicated of #4026 which has already been fixed, but now yet released.

@char0n char0n closed this as completed Jul 26, 2023
@char0n char0n changed the title oneOf must be a non-empty array of schemas SwaggerEditor@next: oneOf must be a non-empty array of schemas Jul 26, 2023
@char0n char0n self-assigned this Jul 26, 2023
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

2 participants