Skip to content

Commit

Permalink
maintenance release
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszm committed Dec 8, 2022
1 parent b02bb4e commit b06775c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 20 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/maven_build_release.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Java CI with Maven
on:
push:
tags:
- v*
tags: [v*]
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/package_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 11 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<groupId>com.amartus.sonata</groupId>
<artifactId>blender</artifactId>
<description>SonataBlendingTool</description>
<version>1.9.2</version>
<version>1.9.3</version>
<properties>
<openapi.generator.version>6.0.1</openapi.generator.version>
<jackson.version>2.14.0</jackson.version>
Expand All @@ -46,7 +46,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>com.github.rvesse</groupId>
Expand All @@ -61,7 +61,7 @@
<dependency>
<groupId>io.swagger.parser.v3</groupId>
<artifactId>swagger-parser-v3</artifactId>
<version>2.1.8</version>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -89,10 +89,17 @@
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.0.73</version>
<version>1.0.74</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/Amartus/LsoBlendingTool</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.amartus.sonata.blender.parser;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.parser.util.OpenAPIDeserializer;
import org.slf4j.Logger;
Expand All @@ -13,7 +14,7 @@ public class DeserializerProvider {
static class AmartusDeserializer extends OpenAPIDeserializer {

@Override
public Schema getSchema(JsonNode node, String location, ParseResult result) {
public Schema getSchema(ObjectNode node, String location, ParseResult result) {
var schema = super.getSchema(node, location, result);
if (schema.get$ref() != null) {
var description = Optional.ofNullable(node.get("description"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SpecValidator {
private final Supplier<JsonSchema> factory;

public SpecValidator(JsonNode specification) {
var jsf = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V201909);
var jsf = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4);
factory = () -> jsf.getSchema(specification);
}
public Collection<ValidationMessage> validate(JsonNode toValidate) {
Expand Down
31 changes: 21 additions & 10 deletions src/test/resources/schemas/3.0/schema.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"id": "https://spec.openapis.org/oas/3.0/schema/2021-09-28",
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",
"type": "object",
"required": [
"openapi",
Expand Down Expand Up @@ -1355,9 +1358,8 @@
"description": "Bearer",
"properties": {
"scheme": {
"enum": [
"bearer"
]
"type": "string",
"pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
}
}
},
Expand All @@ -1371,9 +1373,8 @@
"properties": {
"scheme": {
"not": {
"enum": [
"bearer"
]
"type": "string",
"pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
}
}
}
Expand Down Expand Up @@ -1486,7 +1487,8 @@
"PasswordOAuthFlow": {
"type": "object",
"required": [
"tokenUrl"
"tokenUrl",
"scopes"
],
"properties": {
"tokenUrl": {
Expand All @@ -1513,7 +1515,8 @@
"ClientCredentialsFlow": {
"type": "object",
"required": [
"tokenUrl"
"tokenUrl",
"scopes"
],
"properties": {
"tokenUrl": {
Expand Down Expand Up @@ -1541,7 +1544,8 @@
"type": "object",
"required": [
"authorizationUrl",
"tokenUrl"
"tokenUrl",
"scopes"
],
"properties": {
"authorizationUrl": {
Expand Down Expand Up @@ -1625,7 +1629,14 @@
"headers": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/Header"
"oneOf": [
{
"$ref": "#/definitions/Header"
},
{
"$ref": "#/definitions/Reference"
}
]
}
},
"style": {
Expand Down

0 comments on commit b06775c

Please sign in to comment.