swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.39k stars 2.18k forks source link

swagger core does not support parameter fields defined in swagger spec 2.0 #1537

Closed gaalandr closed 8 years ago

gaalandr commented 9 years ago

To support swagger spec 2.0 the following fields have to be added to SerializableParameter and AbstractSerializableParameter

See spec 2.0 params: https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameterObject

missing fields:

    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor17.
     */
    public Number maximum;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor17
     */
    public Boolean exclusiveMaximum;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor21
     */
    public Number minimum;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor21
     */
    public Boolean exclusiveMinimum;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor26
     */
    public Integer maxLength;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor29
     */
    public Integer minLength;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor33
     */
    public String pattern;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor42
     */
    public Integer maxItems;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor45
     */
    public Integer minItems;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor49
     */
    public Boolean uniqueItems;
    /**
     * See http://json-schema.org/latest/json-schema-validation.html#anchor14
     */
    public Number multipleOf;

recommended solution: https://github.com/swagger-api/swagger-core/pull/1524

Please take take a look.

webron commented 9 years ago

@iushankin - can you please review the linked PR? Make sure it covers everything including tests. If all is well and the build was successful, feel free to merge.

iushankin commented 8 years ago

@webron I approved and merged this PR https://github.com/swagger-api/swagger-core/pull/1524

gaalandr commented 8 years ago

Cool, thank you.

gaalandr commented 8 years ago

Hi,

can you please update the SNAPSHOT artifact at https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-core/1.5.5-SNAPSHOT/

I would need the latest build from swagger-core for the swagger-codegen project. Now my tests are failing.

..or even better would be a 1.5.5 release.

fehguy commented 8 years ago

i just pushed 1.5.5-SNAPSHOT

danialfaridsada commented 7 years ago

Is there any annotation support for minItems, maxItems, etc?

fehguy commented 7 years ago

Not yet, but it's about to be in.