Skip to content

Commit

Permalink
adding parser version as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gracekarina committed Sep 25, 2022
1 parent 9cb5477 commit 2ea5072
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
parserSpecPath:
description: 'output path of the serialized parsed definition'
required: false
parserVersion:
description: 'parser version'
required: false
runs:
using: "composite"
steps:
Expand All @@ -29,9 +32,9 @@ runs:
distribution: 'zulu'
java-version: '11'
- name: Download JAR
run: curl -L "https://oss.sonatype.org/service/local/repositories/snapshots/content/io/swagger/parser/v3/swagger-parser-cli/2.1.3-SNAPSHOT/swagger-parser-cli-2.1.3-20220917.171959-2.jar" -o swagger-parser-cli.jar
run: curl -L "https://repository.sonatype.org/service/local/artifact/maven/content?r=central-proxy&g=io.swagger.parser.v3&a=swagger-parser-cli&e=jar&v="${{ inputs.parserVersion }} -o swagger-parser-cli.jar
shell: bash
- id: execute
name: Execute Jar
run: java -jar swagger-parser-cli.jar ${{ inputs.inputSpec }} ${{ inputs.options }} ${{ inputs.serializationType }} -o ${{ inputs.parserSpecPath }} -l ${{ inputs.logsPath }}
run: java -jar swagger-parser-cli.jar -i ${{ inputs.inputSpec }} ${{ inputs.options }} ${{ inputs.serializationType }} -o ${{ inputs.parserSpecPath }} -l ${{ inputs.logsPath }}
shell: bash
1 change: 1 addition & 0 deletions .github/workflows/validate-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
with:
inputSpec: '/home/runner/work/swagger-parser/swagger-parser/modules/swagger-parser-cli/src/test/resources/fileWithNoErrorMessages.yaml'
options: '-resolve -resolveFully'
parserVersion: '2.1.3-SNAPSHOT'
serializationType: '-json'
logsPath: '/home/runner/work/swagger-parser/swagger-parser/modules/swagger-parser-cli/target/test-classes/parserLogs.yaml'
parserSpecPath: '/home/runner/work/swagger-parser/swagger-parser/modules/swagger-parser-cli/target/test-classes/specParsed.json'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public static List<String> readFromLocation(Namespace args) {
if(args.getString("o") != null) {
if (result.getOpenAPI() != null){
String output;
Yaml.prettyPrint(result.getOpenAPI());
if(args.getString("json") != null){
output = Json.pretty(result.getOpenAPI());
}else if(args.getString("yaml") != null){
Expand Down

0 comments on commit 2ea5072

Please sign in to comment.