Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/spectral/.spectral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ rules:
functionOptions:
match: "^[A-Za-z0-9-._~:/?#\\[\\]@!\\$&'()*+,;=]*$"

xgen-docs-operationId-camel-case:
description: operationId should be camelCased.
given: "$.paths[*]..operationId"
severity: error
message: "Operation ID should be camelCase: {{value}}."
then:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a message like

Suggested change
then:
message: "Operation ID should be camelCase: {{property}}."
then:

so we can see what the current value is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! I will update it

Copy link
Collaborator Author

@andreaangiolillo andreaangiolillo Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to use {{value}} which gives the message 40221:26 error xgen-docs-operationId-camel-case Operation ID should be camelCase: grantMongoDBEmployeeAccess.

Using {{property}} does not give a useful message 40221:26 error xgen-docs-operationId-camel-case Operation ID should be camelCase: operationId.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect I wasn't sure what the right interpolation was, thanks for fixing it

function: casing
functionOptions:
type: camel

xgen-docs-parameter-examples-or-schema:
message: "No example or schema provided for {{property}}."
description: "Without providing a well defined schema or example(s) an API consumer will have a hard time knowing how to interact with this API."
Expand Down
Loading