Skip to content

Commit a71aefa

Browse files
Merge branch 'master' into bugfix/1847-xmlattribute-not-parsed
2 parents 3973d9f + 1f5593d commit a71aefa

File tree

42 files changed

+959
-67
lines changed

Some content is hidden

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

42 files changed

+959
-67
lines changed

.github/issue_template.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!---
2+
Thanks for filing an issue 😄 ! Before you submit, please read the following:
3+
4+
If you're here to report a security issue, please STOP writing an issue and contact us
5+
at security@swagger.io instead!
6+
7+
Search open/closed issues before submitting since someone might have asked the same thing before!
8+
9+
Issues on GitHub are only related to problems of Swagger-Core itself. We'll try to offer support here for your use case, but we can't offer help with projects that use Swagger-Core, like Springfox.
10+
11+
Likewise, we can't accept features or bugs in the Swagger/OpenAPI specifications themselves, or anything that violates the specifications.
12+
-->
13+
14+
<!--- Provide a general summary of the issue in the title above -->
15+
16+
| Q | A
17+
| --------------------------------- | -------
18+
| Bug or feature request? |
19+
| Which Swagger-Core version? |
20+
| Which Java version? |
21+
| Which JAX-RS framework & version? |
22+
23+
<!--- Provide full details about the issue, including any stack trace, errors, actual behaviour, expected behaviour -->

.mvn/wrapper/maven-wrapper.jar

48.4 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
sudo: false
22
language: java
3-
script: mvn clean verify
3+
script: ./mvnw clean verify
44
jdk:
5-
- oraclejdk7
6-
5+
- openjdk7
6+
after_success:
7+
- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ $TRAVIS_PULL_REQUEST == false ]; then
8+
./mvnw clean deploy --settings .travis/settings.xml;
9+
fi;
10+
branches:
11+
only:
12+
- master
13+
- 2.0

.travis/settings.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<settings>
2+
<localRepository/>
3+
<interactiveMode/>
4+
<usePluginRegistry/>
5+
<offline/>
6+
<pluginGroups/>
7+
<servers>
8+
<server>
9+
<id>sonatype-nexus-snapshots</id>
10+
<username>${env.SONATYPE_USERNAME}</username>
11+
<password>${env.SONATYPE_PASSWORD}</password>
12+
</server>
13+
</servers>
14+
<mirrors/>
15+
<proxies/>
16+
<profiles/>
17+
<activeProfiles/>
18+
</settings>

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
3232

3333
Swagger core Version | Release Date | OpenAPI Spec compatibility | Notes | Status
3434
------------------------- | ------------ | -------------------------- | ----- | ----
35+
2.0.0-rc3 | 2017-11-21 | 3.0 | [tag v2.0.0-rc3](https://github.com/swagger-api/swagger-core/tree/v2.0.0-rc3) | Supported
36+
2.0.0-rc2 | 2017-09-29 | 3.0 | [tag v2.0.0-rc2](https://github.com/swagger-api/swagger-core/tree/v2.0.0-rc2) | Supported
3537
2.0.0-rc1 | 2017-08-17 | 3.0 | [tag v2.0.0-rc1](https://github.com/swagger-api/swagger-core/tree/v2.0.0-rc1) | Supported
36-
1.5.16 (**current stable**)| 2017-07-15 | 2.0 | [tag v1.5.16](https://github.com/swagger-api/swagger-core/tree/v1.5.16) | Supported
38+
1.5.17 (**current stable**)| 2017-11-21 | 2.0 | [tag v1.5.17](https://github.com/swagger-api/swagger-core/tree/v1.5.17) | Supported
39+
1.5.16 | 2017-07-15 | 2.0 | [tag v1.5.16](https://github.com/swagger-api/swagger-core/tree/v1.5.16) | Supported
3740
1.3.12 | 2014-12-23 | 1.2 | [tag v1.3.12](https://github.com/swagger-api/swagger-core/tree/v1.3.12) | Supported
3841
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
3942
1.0.0 | 2011-10-16 | 1.0 | [tag v1.0](https://github.com/swagger-api/swagger-core/tree/v1.0) | Deprecated
@@ -60,7 +63,7 @@ You need the following installed and available in your $PATH:
6063
* Apache maven 3.0.4 or greater (http://maven.apache.org/)
6164

6265

63-
### To build from source (currently 1.5.16)
66+
### To build from source (currently 1.5.18-SNAPSHOT)
6467
```
6568
# first time building locally
6669
mvn -N

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>io.swagger</groupId>
55
<artifactId>swagger-project</artifactId>
6-
<version>1.5.16</version>
6+
<version>1.5.18-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010
<groupId>io.swagger</groupId>
1111
<artifactId>swagger-annotations</artifactId>
12-
<version>1.5.16</version>
12+
<version>1.5.18-SNAPSHOT</version>
1313
<packaging>bundle</packaging>
1414
<name>swagger-annotations</name>
1515
<build>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,9 @@
111111
* @since 1.5.11
112112
*/
113113
boolean allowEmptyValue() default false;
114+
115+
/**
116+
* @return an optional array of extensions
117+
*/
118+
Extension[] extensions() default @Extension(properties = @ExtensionProperty(name = "", value = ""));
114119
}

modules/swagger-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>io.swagger</groupId>
55
<artifactId>swagger-project</artifactId>
6-
<version>1.5.16</version>
6+
<version>1.5.18-SNAPSHOT</version>
77
<relativePath>../..</relativePath>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>

modules/swagger-core/src/main/java/io/swagger/jackson/ModelResolver.java

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
package io.swagger.jackson;
22

3+
import java.lang.annotation.Annotation;
4+
import java.lang.reflect.Type;
5+
import java.math.BigDecimal;
6+
import java.util.ArrayList;
7+
import java.util.Arrays;
8+
import java.util.Collections;
9+
import java.util.HashMap;
10+
import java.util.HashSet;
11+
import java.util.Iterator;
12+
import java.util.LinkedHashMap;
13+
import java.util.List;
14+
import java.util.Map;
15+
import java.util.Set;
16+
17+
import javax.validation.constraints.DecimalMax;
18+
import javax.validation.constraints.DecimalMin;
19+
import javax.validation.constraints.Max;
20+
import javax.validation.constraints.Min;
21+
import javax.validation.constraints.Pattern;
22+
import javax.validation.constraints.Size;
23+
import javax.xml.bind.annotation.XmlAccessType;
24+
import javax.xml.bind.annotation.XmlAccessorType;
25+
import javax.xml.bind.annotation.XmlAttribute;
26+
import javax.xml.bind.annotation.XmlElement;
27+
import javax.xml.bind.annotation.XmlRootElement;
28+
import javax.xml.bind.annotation.XmlSchema;
29+
30+
import org.apache.commons.lang3.StringUtils;
31+
import org.slf4j.Logger;
32+
import org.slf4j.LoggerFactory;
33+
334
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
435
import com.fasterxml.jackson.annotation.JsonIdentityReference;
536
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@@ -20,6 +51,7 @@
2051
import com.fasterxml.jackson.databind.jsontype.NamedType;
2152
import com.fasterxml.jackson.databind.type.TypeFactory;
2253
import com.google.common.collect.Iterables;
54+
2355
import io.swagger.annotations.ApiModel;
2456
import io.swagger.annotations.ApiModelProperty;
2557
import io.swagger.converter.ModelConverter;
@@ -40,37 +72,9 @@
4072
import io.swagger.models.properties.UUIDProperty;
4173
import io.swagger.util.AllowableValues;
4274
import io.swagger.util.AllowableValuesUtils;
75+
import io.swagger.util.BaseReaderUtils;
4376
import io.swagger.util.PrimitiveType;
4477
import io.swagger.util.ReflectionUtils;
45-
import org.apache.commons.lang3.StringUtils;
46-
import org.slf4j.Logger;
47-
import org.slf4j.LoggerFactory;
48-
49-
import javax.validation.constraints.DecimalMax;
50-
import javax.validation.constraints.DecimalMin;
51-
import javax.validation.constraints.Max;
52-
import javax.validation.constraints.Min;
53-
import javax.validation.constraints.Pattern;
54-
import javax.validation.constraints.Size;
55-
import javax.xml.bind.annotation.XmlAccessType;
56-
import javax.xml.bind.annotation.XmlAccessorType;
57-
import javax.xml.bind.annotation.XmlAttribute;
58-
import javax.xml.bind.annotation.XmlElement;
59-
import javax.xml.bind.annotation.XmlRootElement;
60-
import javax.xml.bind.annotation.XmlSchema;
61-
import java.lang.annotation.Annotation;
62-
import java.lang.reflect.Type;
63-
import java.math.BigDecimal;
64-
import java.util.ArrayList;
65-
import java.util.Arrays;
66-
import java.util.Collections;
67-
import java.util.HashMap;
68-
import java.util.HashSet;
69-
import java.util.Iterator;
70-
import java.util.LinkedHashMap;
71-
import java.util.List;
72-
import java.util.Map;
73-
import java.util.Set;
7478

7579
public class ModelResolver extends AbstractModelConverter implements ModelConverter {
7680
Logger LOGGER = LoggerFactory.getLogger(ModelResolver.class);
@@ -507,6 +511,12 @@ public Model resolve(JavaType type, ModelConverterContext context, Iterator<Mode
507511
PropertyBuilder.merge(property, args);
508512
}
509513
}
514+
515+
if (mp != null && mp.extensions() != null) {
516+
property.getVendorExtensions().clear();
517+
property.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(mp.extensions()));
518+
}
519+
510520
JAXBAnnotationsHelper.apply(member, property);
511521
applyBeanValidatorAnnotations(property, annotations);
512522
props.add(property);

0 commit comments

Comments
 (0)