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

showObjectSchemaExamples doesn't render examples for object properties #2610

Open
kai687 opened this issue Oct 25, 2024 · 0 comments
Open

showObjectSchemaExamples doesn't render examples for object properties #2610

kai687 opened this issue Oct 25, 2024 · 0 comments

Comments

@kai687
Copy link

kai687 commented Oct 25, 2024

Describe the bug

With the option showObjectSchemaExamples set to true, I only see Example: [object Object] in the description for objects. Other examples, like strings, render fine.

Used [email protected].

Expected behavior

I expected the provided examples for properties of type object to be rendered out.

Example OpenAPI schema
openapi: 3.1.0
info:
  title: Minimal POST API
  version: 1.0.0
paths:
  /example:
    post:
      summary: Example request
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Request body
              properties:
                config:
                  type: object
                  description: Config object
                  example:
                    language: German
                    mode: slow
                  properties:
                    language:
                      type: string
                      description: Language setting
                    mode:
                      type: string
                      enum:
                        - fast
                        - normal
                        - slow
      responses:
        "200":
          description: Success

Screenshots

Image

Additional context

While for objects with defined properties, I can just provide the examples with the properties,
but for objects that accept additionalProperties, it'll be difficult.

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

1 participant