pb33f / libopenapi

libopenapi is a fully featured, high performance OpenAPI 3.1, 3.0 and Swagger parser, library, validator and toolkit for golang applications.
https://pb33f.io/libopenapi/
Other
362 stars 46 forks source link

Validation of simple parameters #258

Closed tksd123 closed 3 months ago

tksd123 commented 3 months ago

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 commented 3 months ago

Hi, How are you validating this? What are you using for validation?

tksd123 commented 3 months ago

sorry mate I realise I've opened this issue on the wrong repo, moving it right now to https://github.com/pb33f/libopenapi-validator