apisyouwonthate / style-guide

A shared and somewhat opinionated style guide for everyone to enjoy.
141 stars 20 forks source link

"Parameters should have a description" rule in schema ruleset is (too?) broad #2

Closed shockey closed 4 years ago

shockey commented 5 years ago

Inputs

openapi.yaml
openapi: "3.0.0"

components:
  parameters:
    MyParam:
      type: object
      properties:
        content: # Warning: Parameters must have a description.
          type: string
  schemas:
    ObjectSchema:
      type: object
      properties:
        content: # Warning: Parameters must have a description.
          type: string
    SchemaWithAPropertyNamedProperties:
      type: object
      properties:
        type: string # Warning: Parameters must have a description.
.spectral.yaml
extends:
- https://raw.githubusercontent.com/openapi-community/style-guide/master/schema-ruleset.yaml
rules: {}

Output

/Users/kyle/Documents/Stoplight Studio/gh/swagger-api/swagger-petstore/reference/test.yaml
  8:17  warning  parameter-description  Parameters must have a description.
 14:17  warning  parameter-description  Parameters must have a description.
 19:20  warning  parameter-description  Parameters must have a description.

I'm not certain this is a bug, but there are a couple of oddities here IMO:

I might just be missing something. Let's discuss!

philsturgeon commented 5 years ago

It should probably only be for stuff inside 'parameters' ey.

philsturgeon commented 4 years ago

Can you fire a PR that solves this @shockey? I've got a few too many plates in their air.