Skip to content

refactor: adjust rule details format in generated markdown report #740

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

Draft
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Apr 10, 2025

This is something I'm proposing for 2.x. Happy to take feedback on the design!


Rather than generating one big table, with lots of wide columns, this generates one table per violation to be more extendable with new fields. It also ends up being more consistent with how the data is displayed in the CLI output.

Here is an example of how it would look after this change:

Detailed results

Rule operation-operationId-unique
Message Every operation must have unique "operationId".
Path paths./pet.put.operationId
Line 52
Severity error
Rule ibm-no-array-responses
Message Operations should not return an array as the top-level structure of a response
Path paths./pet/find_by_status.get.responses.200.content.application/xml.schema
Line 96
Severity error
Rule ibm-no-array-responses
Message Operations should not return an array as the top-level structure of a response
Path paths./pet/find_by_status.get.responses.200.content.application/json.schema
Line 103
Severity error
Rule no-$ref-siblings
Message $ref must not be placed next to any other properties
Path components.schemas.Pet.properties.category.description
Line 184
Severity error
Rule ibm-openapi-tags-used
Message A tag is defined but never used: store
Path tags.1
Line 22
Severity warning
Rule ibm-openapi-tags-used
Message A tag is defined but never used: user
Path tags.2
Line 24
Severity warning
Rule ibm-response-status-codes
Message Operation responses should include at least one success status code (2xx)
Path paths./pet.post.responses
Line 40
Severity warning
Rule ibm-request-and-response-content
Message Request bodies and non-204 responses should define a content object
Path paths./pet.post.responses.405
Line 41
Severity warning
Rule ibm-operationid-naming-convention
Message operationIds should follow naming convention: operationId verb should be replace
Path paths./pet.put.operationId
Line 52
Severity warning
Rule ibm-response-status-codes
Message Operation responses should include at least one success status code (2xx)
Path paths./pet.put.responses
Line 56
Severity warning
Rule ibm-request-and-response-content
Message Request bodies and non-204 responses should define a content object
Path paths./pet.put.responses.400
Line 57
Severity warning
Rule ibm-request-and-response-content
Message Request bodies and non-204 responses should define a content object
Path paths./pet.put.responses.404
Line 59
Severity warning
Rule ibm-request-and-response-content
Message Request bodies and non-204 responses should define a content object
Path paths./pet.put.responses.405
Line 61
Severity warning
Rule ibm-schema-description
Message Schemas should have a non-empty description
Path paths./pet/find_by_status.get.responses.200.content.application/xml.schema
Line 96
Severity warning
Rule ibm-success-response-example
Message Response bodies should include an example response
Path paths./pet/find_by_status.get.responses.200.content.application/json
Line 102
Severity warning
Rule ibm-schema-description
Message Schemas should have a non-empty description
Path paths./pet/find_by_status.get.responses.200.content.application/json.schema
Line 103
Severity warning
Rule ibm-request-and-response-content
Message Request bodies and non-204 responses should define a content object
Path paths./pet/find_by_status.get.responses.400
Line 109
Severity warning
Rule ibm-securityschemes
Message A security scheme is defined but never used
Path components.securitySchemes.api_key
Line 138
Severity warning
Rule ibm-property-description
Message Schema properties should have a non-empty description
Path components.schemas.Category
Line 143
Severity warning
Rule ibm-property-description
Message Schema properties should have a non-empty description
Path components.schemas.Category.properties.id
Line 146
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'pattern'
Path components.schemas.Category.properties.name
Line 151
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'minLength'
Path components.schemas.Category.properties.name
Line 151
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'maxLength'
Path components.schemas.Category.properties.name
Line 151
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'pattern'
Path components.schemas.Tag.properties.name
Line 164
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'minLength'
Path components.schemas.Tag.properties.name
Line 164
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'maxLength'
Path components.schemas.Tag.properties.name
Line 164
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'pattern'
Path components.schemas.Pet.properties.name
Line 185
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'minLength'
Path components.schemas.Pet.properties.name
Line 185
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'maxLength'
Path components.schemas.Pet.properties.name
Line 185
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'pattern'
Path components.schemas.Pet.properties.photo_urls.items
Line 194
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'minLength'
Path components.schemas.Pet.properties.photo_urls.items
Line 194
Severity warning
Rule ibm-string-attributes
Message String schemas should define property 'maxLength'
Path components.schemas.Pet.properties.photo_urls.items
Line 194
Severity warning
Rule oas3-unused-component
Message Potentially unused component has been detected.
Path components.schemas.UnusedString
Line 210
Severity warning

@dpopp07 dpopp07 requested review from hudlow, pyrooka and padamstx April 10, 2025 19:09
Rather than generating one big table, with lots of wide columns, this
generates one table per violation to be more extendable with new fields.
It also ends up being more consistent with how the data is displayed in
the CLI output.

Signed-off-by: Dustin Popp <[email protected]>
@dpopp07 dpopp07 force-pushed the dp/reformat-markdown-ouput branch from 0a05984 to ec65191 Compare April 10, 2025 21:26
@dpopp07 dpopp07 marked this pull request as draft April 21, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant