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

Validation of simple parameters #54

Closed
ndreno opened this issue Feb 22, 2024 · 6 comments
Closed

Validation of simple parameters #54

ndreno opened this issue Feb 22, 2024 · 6 comments

Comments

@ndreno
Copy link

ndreno commented Feb 22, 2024

Hi there, I think I'm facing an issue with validation.

Example like the following:

- in: query
  name: count
  description: number of facts to return
  required: false
  schema:
    type: integer
    format: int32
    minimum: 1

There is no check on the minimum value in that case with simple schema having a primitive type like integer.

When it is working with:

ListSpacesPage:
  name: "page"
  in: "query"
  style: "deepObject"
  description: "list spaces paginated request"
  required: false
  schema:
    type: object
    properties:
      size:
        type: integer
        description: The maximum number of items to return. The service may return fewer than this value.
        minimum: 1
        maximum: 50
        default: 30
        format: int32
        require: false

Is this by design, a bug, or I'm missing something?

Cheers and thank you for this amazing lib and the work you're putting in.

@daveshanley
Copy link
Member

Before I can be helpful, I need to know how you're calling this, what are you validating? a Parameter? a schema? a header? a request? Can you share a code snippet?

@ndreno
Copy link
Author

ndreno commented Feb 22, 2024

hey there, thanks for your quick reply.

We've been trying to validate a query param. I've shared the OAS chunk above where you can see "in: query".
We are simply using the highLevelValidator.ValidateHttpRequest(req)

thanks for your help

@daveshanley
Copy link
Member

I am not sure, I will have to investigate, it's been a hot minute since I looked at that code.

@ndreno
Copy link
Author

ndreno commented Feb 23, 2024

sure no problem, I'm pretty sure the validation method exists, but it is just not called for this specific use case from what I've seen

@emilien-puget
Copy link
Contributor

i made #55 for this issue

@daveshanley
Copy link
Member

Fixed by @emilien-puget in v0.0.43

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

No branches or pull requests

3 participants