Git Product home page Git Product logo

Comments (5)

vincentjames501 avatar vincentjames501 commented on May 19, 2024

+1. Also, is there any reason why minimum and maximum don't apply to type string as well? Seems only logical that one would want to validate the length of a string.

from openapi-specification.

mission-liao avatar mission-liao commented on May 19, 2024

I'm not sure if it's the same issue, if it's not ok to append this to the issue, please let me know.

Now I found that the string representation of minimum & maximum is always number, even if their type is integer. Ex. in http://petstore.swagger.wordnik.com/api/api-docs/pet, we can find this:

{
"name":"petId",
"description":"ID of pet that needs to be fetched",
"required":true,
"type":"integer",
"format":"int64",
"paramType":"path",
"allowMultiple":false,
"minimum":"1.0",
"maximum":"100000.0"}

Is it expected?

from openapi-specification.

webron avatar webron commented on May 19, 2024

@vincentjames501 - in Swagger 2.0 the validation fields would be the same as they are in json schema draft 4. If minimum and maximum apply to string in the schema, they would be applied here as well.

@mission-liao - it's pretty much the same issue, yeah. As mentioned above, it'll be changed in Swagger 2.0.

from openapi-specification.

webron avatar webron commented on May 19, 2024

@vincentjames501 - FYI, for string the proper attributes are minLength and maxLength, both of which are introduced in Swagger 2.0.

from openapi-specification.

webron avatar webron commented on May 19, 2024

This has been resolved in Swagger 2.0.

from openapi-specification.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.