Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/maven-v1-pulls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]
java: [ "8" ]

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B verify --file pom.xml
run: |
ulimit -n 16384
mvn -B verify --file pom.xml -Dsurefire.forkCount=4 -DargLine="-XX:-OmitStackTraceInFastThrow" -Dsurefire.useFile=false
10 changes: 6 additions & 4 deletions .github/workflows/maven-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,32 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8 ]

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven, Deploy snapshot to maven central
run: |
mvn --no-transfer-progress -B verify --file pom.xml
ulimit -n 16384
mvn --no-transfer-progress -B verify --file pom.xml -Dsurefire.forkCount=4 -DargLine="-XX:-OmitStackTraceInFastThrow" -Dsurefire.useFile=false
export MY_JAVA_VERSION=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1`
echo "JAVA VERSION" ${MY_JAVA_VERSION}
if [[ ${MY_JAVA_VERSION} == "8" ]];
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/next-snapshot-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -21,14 +21,15 @@ jobs:
with:
python-version: 2.7
- name: Set up Java 11
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -37,6 +38,7 @@ jobs:
- name: Run pre release script
id: preRelease
run: |
ulimit -n 16384
# export GPG_TTY=$(tty)
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/prepare-release-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -21,14 +21,15 @@ jobs:
with:
python-version: '3.10'
- name: Set up Java 8
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -37,6 +38,7 @@ jobs:
- name: Run prepare release script
id: prepare-release
run: |
ulimit -n 16384
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
then
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
Expand All @@ -21,14 +21,15 @@ jobs:
with:
python-version: '3.10'
- name: Set up Java 8
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -37,6 +38,7 @@ jobs:
- name: Run pre release script
id: preRelease
run: |
ulimit -n 16384
# export GPG_TTY=$(tty)
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ public Info info(ObjectNode node, String location, ParseResult result) {
License license = license(obj, location, result);
info.license(license);

value = getString("version", node, false, location, result);
value = getString("version", node, true, location, result);
info.version(value);

// extra keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1876,4 +1876,12 @@ public void test20SafeURLResolvingWithLocalhost() throws IOException {
new SwaggerParser().read(jsonNodeSwagger, null, parseOptions);
});
}

@Test
public void testIssueSwg14378() {

SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("src/test/resources/issue-swg-14378.yaml", null, false);
assertNotNull(result);
assertEquals("attribute info.version is missing",result.getMessages().get(0));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public void testIssue205() {
"swagger: '2.0'\n" +
"info:\n" +
" title: nice\n" +
" version: '1'\n" +
"paths: {}\n" +
"definitions:\n" +
" Empty:\n" +
Expand Down
10 changes: 10 additions & 0 deletions modules/swagger-parser/src/test/resources/issue-swg-14378.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
swagger: "2.0"
info:
description: some description
title: data
paths:
/tickets:
get:
responses:
200:
description: data
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down
Loading