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

Rule idea: no-unnecessary-combinator #513

Open
silverwind opened this issue Jun 24, 2024 · 1 comment
Open

Rule idea: no-unnecessary-combinator #513

silverwind opened this issue Jun 24, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@silverwind
Copy link
Contributor

silverwind commented Jun 24, 2024

A combinator like allOf, anyOf or oneOf with only a single member is useless and could trigger a warning:

openapi: 3.0.3
components:
  schemas:
    foo:
      type: string
    bar:
      allOf:
        - "$ref": "/components/schemas/foo"

Corrected, the schema for bar would be:

    bar:
      "$ref": "/components/schemas/foo"
@daveshanley
Copy link
Owner

Nice idea! will add it to the list

@daveshanley daveshanley added the enhancement New feature or request label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants