Skip to content

Commit 945c318

Browse files
committed
Updated javadocs
1 parent 1ae1863 commit 945c318

File tree

11 files changed

+83
-57
lines changed

11 files changed

+83
-57
lines changed

modules/swagger-annotations/src/main/java/io/swagger/annotations/ApiImplicitParam.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
* <li>To set a list of values, provide a comma-separated list.
6666
* For example: {@code first, second, third}.</li>
6767
* <li>To set a range of values, start the value with "range", and surrounding by square
68-
* brackets include the minimum and maximum values. For example: {@code range[1, 5]}.</li>
68+
* brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
69+
* For example: {@code range[1, 5]}, {@code range(1, 5)}, {@code range[1, 5)}.</li>
6970
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
7071
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
7172
* minimum allowable value of this parameter is 1.</li>

modules/swagger-annotations/src/main/java/io/swagger/annotations/ApiModelProperty.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
String name() default "";
4141

4242
/**
43-
* Limits the acceptable values for this property.
43+
* Limits the acceptable values for this parameter.
4444
* <p>
4545
* There are three ways to describe the allowable values:
4646
* <ol>
4747
* <li>To set a list of values, provide a comma-separated list.
4848
* For example: {@code first, second, third}.</li>
4949
* <li>To set a range of values, start the value with "range", and surrounding by square
50-
* brackets include the minimum and maximum values. For example: {@code range[1, 5]}.</li>
50+
* brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
51+
* For example: {@code range[1, 5]}, {@code range(1, 5)}, {@code range[1, 5)}.</li>
5152
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
5253
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
5354
* minimum allowable value of this parameter is 1.</li>

modules/swagger-annotations/src/main/java/io/swagger/annotations/ApiParam.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,13 @@
5555
/**
5656
* Limits the acceptable values for this parameter.
5757
* <p>
58-
* If the original parameter type is an enum, the values of the enum would be translated to
59-
* the allowableValues. Those can be overridden by setting this property.
60-
* <p>
6158
* There are three ways to describe the allowable values:
6259
* <ol>
6360
* <li>To set a list of values, provide a comma-separated list.
6461
* For example: {@code first, second, third}.</li>
6562
* <li>To set a range of values, start the value with "range", and surrounding by square
66-
* brackets include the minimum and maximum values. For example: {@code range[1, 5]}.</li>
63+
* brackets include the minimum and maximum values, or round brackets for exclusive minimum and maximum values.
64+
* For example: {@code range[1, 5]}, {@code range(1, 5)}, {@code range[1, 5)}.</li>
6765
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
6866
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
6967
* minimum allowable value of this parameter is 1.</li>

modules/swagger-annotations/src/main/java/io/swagger/annotations/Contact.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,31 @@
2424
/**
2525
* Contact metadata available within the info section of a Swagger definition - see
2626
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#contactObject
27+
*
28+
* @since 1.5.0
2729
*/
28-
2930
@Target(ElementType.ANNOTATION_TYPE)
3031
@Retention(RetentionPolicy.RUNTIME)
3132
public @interface Contact {
3233

3334
/**
35+
* The name of the contact.
36+
*
3437
* @return the name of the contact
3538
*/
36-
3739
String name();
3840

3941
/**
42+
* Optional URL associated with this contact.
43+
*
4044
* @return an optional URL associated with this contact
4145
*/
42-
4346
String url() default "";
4447

4548
/**
49+
* Optional email for this contact.
50+
*
4651
* @return an optional email for this contact
4752
*/
48-
4953
String email() default "";
5054
}

modules/swagger-annotations/src/main/java/io/swagger/annotations/Extension.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,25 @@
2323

2424
/**
2525
* An optionally named list of extension properties.
26+
*
27+
* @since 1.5.0
2628
*/
27-
2829
@Target(ElementType.ANNOTATION_TYPE)
2930
@Retention(RetentionPolicy.RUNTIME)
3031
public @interface Extension {
3132

3233
/**
34+
* An option name for these extensions.
35+
*
3336
* @return an option name for these extensions - will be prefixed with "x-"
3437
*/
35-
3638
String name() default "";
3739

3840
/**
41+
* The extension properties.
42+
*
3943
* @see ExtensionProperty
4044
* @return the actual extension properties
4145
*/
42-
4346
ExtensionProperty[] properties();
4447
}

modules/swagger-annotations/src/main/java/io/swagger/annotations/ExtensionProperty.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,23 @@
2525
* A name/value property within a Swagger extension
2626
*
2727
* @see Extension
28+
* @since 1.5.0
2829
*/
29-
3030
@Target(ElementType.ANNOTATION_TYPE)
3131
@Retention(RetentionPolicy.RUNTIME)
3232
public @interface ExtensionProperty {
3333

3434
/**
35+
* The name of the property.
36+
*
3537
* @return the name of the property
3638
*/
37-
3839
String name();
3940

4041
/**
42+
* The value of the property.
43+
*
4144
* @return the value of the property
4245
*/
43-
4446
String value();
4547
}

modules/swagger-annotations/src/main/java/io/swagger/annotations/ExternalDocs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
/**
2525
* Represents an external documentation description.
26-
*
27-
* @since 1.5.2-M1
26+
*
27+
* @since 1.5.0
2828
*/
2929
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD})
3030
@Retention(RetentionPolicy.RUNTIME)

modules/swagger-annotations/src/main/java/io/swagger/annotations/Info.java

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,53 +24,60 @@
2424
/**
2525
* High-level metadata for a Swagger definition - see
2626
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#infoObject
27+
*
28+
* @since 1.5.0
2729
*/
28-
2930
@Target(ElementType.ANNOTATION_TYPE)
3031
@Retention(RetentionPolicy.RUNTIME)
3132
public @interface Info {
3233

3334
/**
35+
* The title of the API.
36+
*
3437
* @return the title of the API
3538
*/
36-
3739
String title();
3840

3941
/**
42+
* The version of your API.
43+
*
4044
* @return the version of your API
4145
*/
42-
4346
String version();
4447

4548
/**
49+
* An optional description of the API.
50+
*
4651
* @return an optional description of the API
4752
*/
48-
4953
String description() default "";
5054

5155
/**
56+
* An optional terms of service for this API.
57+
*
5258
* @return an optional terms of service for this API
5359
*/
54-
5560
String termsOfService() default "";
5661

5762
/**
63+
* Optional contact information for this API.
64+
*
5865
* @return optional contact information for this API
5966
*/
60-
6167
Contact contact() default @Contact( name = "");
6268

6369
/**
70+
* Optional license information for this API.
71+
*
6472
* @return optional license information for this API
6573
*/
66-
6774
License license() default @License( name = "" );
6875

6976
/**
77+
* Optional list of extensions for this API.
78+
*
7079
* @see Extension
7180
* @return optional list of extensions for this API
7281
*/
73-
74-
7582
Extension[] extensions() default @Extension( properties = @ExtensionProperty(name="",value=""));
7683
}

modules/swagger-annotations/src/main/java/io/swagger/annotations/License.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,25 @@
2424
/**
2525
* License metadata available within the info section of a Swagger definition, see
2626
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#licenseObject
27+
*
28+
* @since 1.5.0
2729
*/
2830

2931
@Target(ElementType.ANNOTATION_TYPE)
3032
@Retention(RetentionPolicy.RUNTIME)
3133
public @interface License {
3234

3335
/**
36+
* The name of the license.
37+
*
3438
* @return the name of the license
3539
*/
36-
3740
String name();
3841

3942
/**
43+
* An optional URL for the license.
44+
*
4045
* @return an optional URL for the license.
4146
*/
42-
4347
String url() default "";
4448
}

modules/swagger-annotations/src/main/java/io/swagger/annotations/SwaggerDefinition.java

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,83 +28,84 @@
2828
* - Security Requirements
2929
* - Parameters
3030
* - Responses
31+
*
32+
* @since 1.5.0
3133
*/
32-
3334
@Target(ElementType.TYPE)
3435
@Retention(RetentionPolicy.RUNTIME)
3536
@Inherited
3637
public @interface SwaggerDefinition {
3738

3839
/**
40+
* The host to specify in the generated Swagger definition.
41+
*
3942
* @return the host to specify in the generated Swagger definition - keep empty for default
4043
*/
41-
4244
String host() default "";
4345

4446
/**
47+
* The basePath to specify in the generated Swagger definition.
48+
*
4549
* @return the basePath to specify in the generated Swagger definition - keep empty for default
4650
*/
47-
4851
String basePath() default "";
4952

5053
/**
51-
* Global level consumes for this swagger definition, will be added to all api definitions that
52-
* don't have local overrides - see
54+
* Global level consumes for this swagger definition.
55+
* <p>
56+
* These will be added to all api definitions that don't have local overrides - see
5357
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#swagger-object
5458
*
55-
* @return a list of global level consumes
59+
* @return a list of global level consumes.
5660
*/
57-
5861
String [] consumes() default "";
5962

6063
/**
61-
* Global level produces for this swagger definition, will be added to all api definitions that
62-
* don't have local overrides - see
64+
* Global level produces for this swagger definition.
65+
* <p>
66+
* These will be added to all api definitions that don't have local overrides - see
6367
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#swagger-object
6468
*
6569
* @return a list of global level consumes
6670
*/
67-
6871
String [] produces() default "";
6972

7073
/**
71-
* The transfer protocol of the API. Setting this to Scheme.DEFAULT will result in
72-
* the result being generated from the hosting container.
74+
* The transfer protocol of the API.
75+
* <p>
76+
* Setting this to Scheme.DEFAULT will result in the result being generated from the hosting container.
7377
*
7478
* @return list of supported transfer protocols, keep empty for default
7579
*/
76-
7780
Scheme [] schemes() default Scheme.DEFAULT;
7881

7982
/**
8083
* Enumeration with valid schemes
8184
*/
82-
8385
enum Scheme { DEFAULT, HTTP, HTTPS, WS, WSS };
8486

8587
/**
86-
* Global tags that can be used to tag inidividual Apis and ApiOperations. See
87-
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#tagObject
88+
* Global tags that can be used to tag individual Apis and ApiOperations.
89+
* <p>
90+
* See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#tagObject
8891
*
8992
* @return list of globally defined tags
9093
*/
91-
9294
Tag [] tags() default @Tag( name = "" );
9395

9496
/**
95-
* General metadata for this Swagger definition. See
96-
* https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#infoObject
97+
* General metadata for this Swagger definition.
98+
* <p>
99+
* See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#infoObject
97100
*
98101
* @return general metadata for this Swagger definition
99102
*/
100-
101103
Info info() default @Info( title = "", version = "" );
102104

103105
/**
104-
* Reference to external documentation for this Swagger definition
106+
* Reference to external documentation for this Swagger definition.
105107
*
106108
* @return a reference to external documentation
107109
*/
108-
109110
ExternalDocs externalDocs() default @ExternalDocs( url = "");
110111
}

0 commit comments

Comments
 (0)