Skip to content

anyOf parameters always listed as X | (X | Y) #10654

@multimeric

Description

@multimeric

Q&A (please complete the following information)

  • OS: macOS
  • Browser: FireFox
  • Version: 140.5
  • Method of installation: downloaded the pre-compiled bundle and used the dist/ directory
  • Swagger-UI version: 5.30.3
  • Swagger/OpenAPI version: 3.1.0

Content & configuration

Example Swagger/OpenAPI definition:

{
    "openapi": "3.1.0",
    "paths": {
        "/greet": {
            "get": {
                "parameters": [
                    {
                        "name": "name",
                        "schema": {
                            "anyOf": [
                                {
                                    "type": "string"
                                },
                                {
                                    "type": "integer"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    }
}

Swagger-UI configuration options:
Not changed from defaults

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Create an OpenAPI spec that uses anyOf for a parameter
  2. Look at the generated docs for that parameter

Expected behavior

In the above example, I expect to see string | integer

Screenshots

Image

Additional context or thoughts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions