Skip to content

Commit 13e8bf3

Browse files
committed
Merge branch 'develop_2.0'
2 parents ee0b639 + db79cc2 commit 13e8bf3

File tree

384 files changed

+10157
-1678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+10157
-1678
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2015 Reverb Technologies, Inc.
1+
Copyright 2015 SmartBear Software
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The Swagger Specification has undergone 3 revisions since initial creation in 20
2929

3030
Swagger core Version | Release Date | Swagger Spec compatibility | Notes | Status
3131
------------------------- | ------------ | -------------------------- | ----- | ----
32-
1.5.1-M2 | 2015-04-05 | 2.0 | [master](https://github.com/swagger-api/swagger-core) | Supported
32+
1.5.2-M2 | 2015-04-05 | 2.0 | [master](https://github.com/swagger-api/swagger-core) | Supported
3333
1.3.12 | 2014-12-23 | 1.2 | [tag v1.3.12](https://github.com/swagger-api/swagger-core/tree/v1.3.12) | Supported
3434
1.2.4 | 2013-06-19 | 1.1 | [tag swagger-project_2.10.0-1.2.4](https://github.com/swagger-api/swagger-core/tree/swagger-project_2.10.0-1.2.4) | Deprecated
3535
1.0.0 | 2011-10-16 | 1.0 | [tag v1.0](https://github.com/swagger-api/swagger-core/tree/v1.0) | Deprecated
@@ -38,7 +38,7 @@ Swagger core Version | Release Date | Swagger Spec compatibility | Notes |
3838
To allow independent development, scala support has been moved into a separate project. See the [swagger-scala-module](https://github.com/swagger-api/swagger-scala-module) for details. Play! framework support is moving outside the swagger-core project as well.
3939

4040
## Overview
41-
This is a project to build the swagger-core library, which is required for the Reverb implementation of the Swagger spec.
41+
This is a project to build the swagger-core library, which is required for the Swagger implementation of the Swagger spec.
4242

4343
### Change History
4444
If you're interested in the change history of swagger and the swagger-core framework, see [here](https://github.com/swagger-api/swagger-core/wiki/Changelog).
@@ -52,7 +52,7 @@ You need the following installed and available in your $PATH:
5252
* Jackson 2.4.2 or greater
5353

5454

55-
### To build from source (currently 1.5.1-M2)
55+
### To build from source (currently 1.5.2-M2)
5656
```
5757
# first time building locally
5858
mvn -N
@@ -81,7 +81,7 @@ There are a number of sample apps in the [samples](https://github.com/swagger-ap
8181
License
8282
-------
8383
84-
Copyright 2015 Reverb Technologies, Inc.
84+
Copyright 2015 SmartBear Software
8585
8686
Licensed under the Apache License, Version 2.0 (the "License");
8787
you may not use this file except in compliance with the License.

modules/swagger-annotations/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<parent>
44
<groupId>com.wordnik</groupId>
55
<artifactId>swagger-project</artifactId>
6-
<version>1.5.1-M2</version>
6+
<version>1.5.2-M2</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>com.wordnik</groupId>
1111
<artifactId>swagger-annotations</artifactId>
12-
<version>1.5.1-M2</version>
12+
<version>1.5.2-M2</version>
1313
<packaging>bundle</packaging>
1414
<name>swagger-annotations</name>
1515

modules/swagger-annotations/src/main/java/com/wordnik/swagger/annotations/Api.java

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015 Reverb Technologies, Inc.
2+
* Copyright 2015 SmartBear Software
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,10 +22,7 @@
2222
/**
2323
* Marks a class as a Swagger resource.
2424
* <p>
25-
* The resource affects both the root document of Swagger, the Resource
26-
* Listing, and the API Declaration of that specific resource.
27-
* <p>
28-
* Swagger will only include and introspect only classes that are annotated
25+
* By default, Swagger-Core will only include and introspect only classes that are annotated
2926
* with {@code @Api} and will ignore other resources (JAX-RS endpoints, Servlets and
3027
* so on).
3128
*/
@@ -34,85 +31,77 @@
3431
@Inherited
3532
public @interface Api {
3633
/**
37-
* The 'path' that is going to be used to host the API Declaration of the
38-
* resource.
34+
* Implicitly sets a tag for the operations, legacy support (read description).
3935
* <p>
40-
* For JAX-RS resources, this would normally have the same value as the {@code @Path}
41-
* on the resource, but can be any other value as well. It will serve as the path
42-
* where the documentation is hosted.
36+
* In swagger-core 1.3.X, this was used as the 'path' that is to host the API Declaration of the
37+
* resource. This is no longer relevant in swagger-core 1.5.X.
4338
* <p>
44-
* For Servlets, this path has to be the path serving the Servlet.
39+
* If {@link #tags()} is <i>not</i> used, this value will be used to set the tag for the operations described by this
40+
* resource. Otherwise, the value will be ignored.
4541
* <p>
46-
* If the value isn't preceded with a slash, one would be added to it.
47-
*
48-
* @return the document location value, or empty string if not set
42+
* The leading / (if exists) will be removed.
43+
*
44+
* @return tag name for operations under this resource, unless {@link #tags()} is defined.
4945
*/
5046
String value() default "";
5147

5248
/**
5349
* A list of tags for API documentation control.
5450
* Tags can be used for logical grouping of operations by resources or any other qualifier.
51+
* <p>
52+
* A non-empty value will override the value provided in {@link #value()}.
5553
*
56-
* @since 1.5.2
54+
* @since 1.5.2-M1
5755
*
5856
* @return a string array of tag values
5957
*/
6058
String[] tags() default "";
6159

6260
/**
63-
* Corresponds to the `description` field of the Resource Listing API operation.
64-
* <p>
65-
* This should be a short description of the resource.
61+
* Not used in 1.5.X, kept for legacy support.
6662
*
67-
* @return a longer description about this API
63+
* @return a longer description about this API, no longer used.
6864
*/
65+
@Deprecated
6966
String description() default "";
7067

7168
/**
72-
* Corresponds to the `basePath` field of the API Declaration.
73-
* <p>
74-
* The `basePath` is derived automatically by Swagger. This property allows
75-
* overriding the default value if needed. for swagger 2.0 specifications, this
76-
* value is no longer supported
77-
*
78-
* @since 1.3.7
69+
* Not used in 1.5.X, kept for legacy support.
7970
*
80-
* @return the basePath for this operation
71+
* @return the basePath for this operation, no longer used.
8172
*/
8273
@Deprecated
8374
String basePath() default "";
8475

8576
/**
86-
* Optional explicit ordering of this API resource in the Resource Listing.
87-
* As of swagger-spec 2.0, this value is no longer used
88-
*
77+
* Not used in 1.5.X, kept for legacy support.
8978
*
90-
* @return the position of this API in the resource listing
79+
* @return the position of this API in the resource listing, no longer used.
9180
*/
9281
@Deprecated
9382
int position() default 0;
9483

9584
/**
96-
* Corresponds to the `produces` field of the API Declaration.
85+
* Corresponds to the `produces` field of the operations under this resource.
9786
* <p>
9887
* Takes in comma-separated values of content types.
99-
* For example, "application/json, application/xml" would suggest this API Resource
100-
* generates JSON and XML output.
88+
* For example, "application/json, application/xml" would suggest the operations
89+
* generate JSON and XML output.
10190
* <p>
10291
* For JAX-RS resources, this would automatically take the value of the {@code @Produces}
10392
* annotation if such exists. It can also be used to override the {@code @Produces} values
10493
* for the Swagger documentation.
10594
*
106-
* @return the supported media types supported by the server, or an empty string if not set
95+
* @return the supported media types supported by the server, or an empty string if not set.
10796
*/
10897
String produces() default "";
10998

11099
/**
111-
* Corresponds to the `consumes` field of the API Declaration.
100+
* Corresponds to the `consumes` field of the operations under this resource.
112101
* <p>
113102
* Takes in comma-separated values of content types.
114-
* For example, "application/json, application/xml" would suggest this API Resource
115-
* accepts JSON and XML input.
103+
* For example, "application/json, application/xml" would suggest the operations
104+
* accept JSON and XML input.
116105
* <p>
117106
* For JAX-RS resources, this would automatically take the value of the {@code @Consumes}
118107
* annotation if such exists. It can also be used to override the {@code @Consumes} values
@@ -123,28 +112,28 @@
123112
String consumes() default "";
124113

125114
/**
126-
* This property is currently not in use.
115+
* Sets specific protocols (schemes) for the operations under this resource.
116+
* <p>
117+
* Comma-separated values of the available protocols. Possible values: http, https, ws, wss.
127118
*
128-
* @return the protocols supported by the server
119+
* @return the protocols supported by the operations under the resource.
129120
*/
130121
String protocols() default "";
131122

132123
/**
133-
* Corresponds to the `authorizations` field of the API Declaration.
124+
* Corresponds to the `security` field of the Operation Object.
134125
* <p>
135-
* Takes in a list of the required authorizations for this API Resource.
126+
* Takes in a list of the authorizations (security requirements) for the operations under this resource.
136127
* This may be overridden by specific operations.
137128
*
138129
* @see Authorization
139130
*
140-
* @return an array of authorizations required by the server, or a single, empty authorization value if not set
131+
* @return an array of authorizations required by the server, or a single, empty authorization value if not set.
141132
*/
142-
Authorization[] authorizations() default @Authorization(value = "", type = "");
133+
Authorization[] authorizations() default @Authorization(value = "");
143134

144135
/**
145-
* Hides the api.
146-
*
147-
* @since 1.3.8
136+
* Hides the operations under this resource.
148137
*
149138
* @return true if the api should be hidden from the swagger documentation
150139
*/

modules/swagger-annotations/src/main/java/com/wordnik/swagger/annotations/ApiImplicitParam.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015 Reverb Technologies, Inc.
2+
* Copyright 2015 SmartBear Software
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@
4141
* For proper Swagger functionality, follow these rules when naming your parameters based on {@link #paramType()}:
4242
* <ol>
4343
* <li>If {@code paramType} is "path", the name should be the associated section in the path.</li>
44-
* <li>If {@code paramType} is "body", the name should be "body".</li>
4544
* <li>For all other cases, the name should be the parameter name as your application expects to accept.</li>
4645
* </ol>
4746
*
@@ -64,8 +63,8 @@
6463
* <p>
6564
* There are three ways to describe the allowable values:
6665
* <ol>
67-
* <li>To set a list of values, provide a comma-separated list surrounded by square brackets.
68-
* For example: {@code [first, second, third]}.</li>
66+
* <li>To set a list of values, provide a comma-separated list.
67+
* For example: {@code first, second, third}.</li>
6968
* <li>To set a range of values, start the value with "range", and surrounding by square
7069
* brackets include the minimum and maximum values. For example: {@code range[1, 5]}.</li>
7170
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
@@ -84,11 +83,13 @@
8483

8584
/**
8685
* Allows for filtering a parameter from the API documentation.
86+
*<p>
87+
* See com.wordnik.swagger.core.filter.SwaggerSpecFilter for further details.
8788
*/
8889
String access() default "";
8990

9091
/**
91-
* Specifies whether the parameter can accept multiple comma-separated values.
92+
* Specifies whether the parameter can accept multiple values by having multiple occurrences.
9293
*/
9394
boolean allowMultiple() default false;
9495

modules/swagger-annotations/src/main/java/com/wordnik/swagger/annotations/ApiImplicitParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015 Reverb Technologies, Inc.
2+
* Copyright 2015 SmartBear Software
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

modules/swagger-annotations/src/main/java/com/wordnik/swagger/annotations/ApiModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015 Reverb Technologies, Inc.
2+
* Copyright 2015 SmartBear Software
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2015 Reverb Technologies, Inc.
2+
* Copyright 2015 SmartBear Software
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,73 +21,80 @@
2121
import java.lang.annotation.RetentionPolicy;
2222
import java.lang.annotation.Target;
2323

24-
/**
25-
* An ApiModelProperty desecribes a property inside a model class. The annotations can
26-
* apply to a method, a property, etc., depending on how the model scanner is configured and
27-
* used.
24+
/**
25+
* Adds and manipulates data of a model property.
2826
*/
2927
@Target({ElementType.METHOD, ElementType.FIELD})
3028
@Retention(RetentionPolicy.RUNTIME)
3129
public @interface ApiModelProperty {
32-
/** Provide a human readable synopsis of this property */
30+
/**
31+
* A brief description of this property.
32+
*/
3333
String value() default "";
3434

3535
/**
36-
* Allows overriding the name of the property
36+
* Allows overriding the name of the property.
3737
*
3838
* @return the overridden property name
3939
*/
4040
String name() default "";
4141

4242
/**
43-
* If the values that can be set are restricted, they can be set here. In the form of a comma separated list
44-
* <code>registered, active, closed</code>.
45-
*
46-
* @return the allowable values
43+
* Limits the acceptable values for this property.
44+
* <p>
45+
* There are three ways to describe the allowable values:
46+
* <ol>
47+
* <li>To set a list of values, provide a comma-separated list.
48+
* For example: {@code first, second, third}.</li>
49+
* <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>
51+
* <li>To set a minimum/maximum value, use the same format for range but use "infinity"
52+
* or "-infinity" as the second value. For example, {@code range[1, infinity]} means the
53+
* minimum allowable value of this parameter is 1.</li>
54+
* </ol>
4755
*/
4856
String allowableValues() default "";
4957

50-
/**
51-
* specify an optional access value for filtering in a Filter
52-
* implementation. This
53-
* allows you to hide certain parameters if a user doesn't have access to them
58+
/**
59+
* Allows for filtering a property from the API documentation. See com.wordnik.swagger.core.filter.SwaggerSpecFilter.
5460
*/
5561
String access() default "";
5662

57-
/** long description of the property */
63+
/**
64+
* Currently not in use.
65+
*/
5866
String notes() default "";
5967

6068
/**
61-
* The dataType. See the documentation for the supported datatypes. If the data type is a custom object, set
62-
* it's name, or nothing. In case of an enum use 'string' and allowableValues for the enum constants.
69+
* The data type of the parameter.
70+
* <p>
71+
* This can be the class name or a primitive. The value will override the data type as read from the class
72+
* property.
6373
*/
6474
String dataType() default "";
6575

6676
/**
67-
* Whether or not the property is required, defaults to false.
68-
*
69-
* @return true if required, false otherwise
77+
* Specifies if the parameter is required or not.
7078
*/
7179
boolean required() default false;
7280

7381
/**
74-
* allows explicitly ordering the property in the model. Since reflection has no guarantee on
75-
* ordering, you should specify property order to keep models consistent across different VM implementations and versions.
82+
* Allows explicitly ordering the property in the model.
7683
*/
7784
int position() default 0;
78-
85+
7986
/**
80-
* Allows a model property to be marked as hidden in the swagger model definition
87+
* Allows a model property to be hidden in the Swagger model definition.
8188
*/
8289
boolean hidden() default false;
8390

8491
/**
85-
* A sample value for the property
86-
**/
92+
* A sample value for the property.
93+
*/
8794
String example() default "";
8895

8996
/**
90-
* Allows a model property to be designated as read only
91-
**/
97+
* Allows a model property to be designated as read only.
98+
*/
9299
boolean readOnly() default false;
93100
}

0 commit comments

Comments
 (0)