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

Should not complain about missing server if you yaml contains only components #57

Closed
cvgaviao opened this issue Nov 29, 2023 · 3 comments

Comments

@cvgaviao
Copy link

cvgaviao commented Nov 29, 2023

What happened?
I'm getting an error mark in an yaml containing only components

What should have happened instead?
The missing server rule must be applied only when paths (or webhook?) are present.

Also, I'm getting never used warnings for all schemas in this case.

Minimal reproducible OpenAPI snippet

openapi: 3.1.0
info: 
  title: Common Schemas
  version: "latest"

components: 
  schemas: 
    BusinessUnit:
      title: BusinessUnit
      type: object
      properties:
        id:
          type: integer
          format: int32
        description:
          type: string

If possible, include a short example of your OpenAPI definition that we can use to simulate the problem.

Screenshots
image

Additional context

Release 0.3.3 (2023-11-16)

@lornajane
Copy link

I think this is related to (if not exactly a duplicate) #51

@tatomyr
Copy link
Contributor

tatomyr commented Nov 29, 2023

This is not an extension issue. The behaviour of the Redocly CLI linter will be the same. Could you provide a link to the specification to clarify the correct behaviour?

Also, I'm getting never used warnings for all schemas in this case.

They are unused indeed 🙂. You can turn off warnings or make any other adjustments to rules using Redocly config: https://redocly.com/docs/cli/configuration/rules/#configure-your-linting-rules

@adamaltman
Copy link
Member

I don't think this is a bug.

Our default rules are (mildly) opinionated, and if you don't supply a redocly.yaml to turn off the server or unused components rules you will see errors or warnings.

You can control with a configuration file.

Please re-open if you think I'm incorrectly closing this as "not a bug"...

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

4 participants