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

New lint rule for detecting missing sample fragments #12

Open
savvyintegrations opened this issue Aug 1, 2024 · 2 comments
Open

New lint rule for detecting missing sample fragments #12

savvyintegrations opened this issue Aug 1, 2024 · 2 comments
Labels

Comments

@savvyintegrations
Copy link

Reason/Context

In cases where both a path param and request body are marked as required, it would be great to have a lint rule that detected if one or both are missing fragments to form a complete sample.

Description

For more info see microcks/microcks#1256

Implementation ideas

No response

@lbroudoux
Copy link
Member

I come back to this one, and I think, in fact, that the rule is already in place. We have this one today:

  microcks-examples-in-required-parameter:
    description: Required param must have examples
    message: "Required param must have examples"
    formats:
      - oas3
    severity: warn
    given: "$..parameters[?(@.required == true)]"
    then:
      field: examples
      function: truthy

that is actually fired by the example resources in that project:

49:11  warning  microcks-examples-in-required-parameter        Required param must have examples                                                                                                                                                                         paths./forecast/{region}.get.parameters[1]

I just wonder if the severity level shouldn't be upgraded to error instead of a simple warn? That's maybe what makes it go under the radar... What do you think?

@lbroudoux lbroudoux added kind/question Further information is requested component/openapi-rules labels Sep 13, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants