Skip to content

Commit

Permalink
Merge pull request #591 from bci-oss/590-update-generated-http-path-i…
Browse files Browse the repository at this point in the history
…n-openapi

Changes:
  • Loading branch information
Yauhenikapl authored Jun 12, 2024
2 parents b9f5458 + d8249ac commit 8f1d533
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ private ObjectNode getPathsNode( final Aspect aspect, final OpenApiSchemaGenerat
includeQueryPathNode.set( FIELD_POST,
merge( getRequestEndpointFilter( aspect, propertiesNode, config.baseUrl(), apiVersion, config.resourcePath() ),
queriesTemplate, FIELD_POST ) );
endpointPathsNode.set( config.baseUrl() + String.format( QUERY_SERVER_PATH, apiVersion ) + finalResourcePath,
endpointPathsNode.set( String.format( QUERY_SERVER_PATH, apiVersion ) + finalResourcePath,
includeQueryPathNode );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void testIncludeQueryApiWithSemanticVersion( final KnownVersion metaModelVersion
final JsonNode json = apiJsonGenerator.apply( aspect, config ).getContent();
final SwaggerParseResult result = new OpenAPIParser().readContents( json.toString(), null, null );
final OpenAPI openApi = result.getOpenAPI();
assertThat( openApi.getPaths().get( "https://test-aspect.example.com/query-api/v1.0.0/" + TEST_RESOURCE_PATH ).getPost().getServers()
assertThat( openApi.getPaths().get( "/query-api/v1.0.0/" + TEST_RESOURCE_PATH ).getPost().getServers()
.get( 0 ).getUrl() )
.isEqualTo( "https://test-aspect.example.com/query-api/v1.0.0" );
}
Expand All @@ -193,7 +193,7 @@ void testDefaultResourcePath( final KnownVersion metaModelVersion ) {
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNull();
assertThat( openApi.getPaths().keySet() ).anyMatch( path -> path.equals( apiEndpoint ) );
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand Down Expand Up @@ -226,7 +226,7 @@ void testWithValidResourcePath( final KnownVersion metaModelVersion ) {

assertThat( openApi.getPaths().keySet() ).anyMatch( path -> path.equals( "/" + TEST_RESOURCE_PATH ) );
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0/" + TEST_RESOURCE_PATH ) );
path -> path.equals( "/query-api/v1.0.0/" + TEST_RESOURCE_PATH ) );
}

@ParameterizedTest
Expand Down Expand Up @@ -549,7 +549,7 @@ void testAspectWithAllCrud( final KnownVersion metaModelVersion ) {
assertThat( openApi.getPaths().get( apiEndpoint ).getPut() ).isNotNull();
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNotNull();
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand All @@ -573,7 +573,7 @@ void testAspectWithPostOperation( final KnownVersion metaModelVersion ) {
assertThat( openApi.getPaths().get( apiEndpoint ).getPut() ).isNull();
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNull();
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand All @@ -597,7 +597,7 @@ void testAspectWithPutOperation( final KnownVersion metaModelVersion ) {
assertThat( openApi.getPaths().get( apiEndpoint ).getPut() ).isNotNull();
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNull();
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand All @@ -621,7 +621,7 @@ void testAspectWithPatchOperation( final KnownVersion metaModelVersion ) {
assertThat( openApi.getPaths().get( apiEndpoint ).getPut() ).isNull();
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNotNull();
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand All @@ -646,7 +646,7 @@ void testAspectWithPatchAndPostOperation( final KnownVersion metaModelVersion )
assertThat( openApi.getPaths().get( apiEndpoint ).getPut() ).isNull();
assertThat( openApi.getPaths().get( apiEndpoint ).getPatch() ).isNotNull();
assertThat( openApi.getPaths().keySet() ).anyMatch(
path -> path.equals( "https://test-aspect.example.com/query-api/v1.0.0" + apiEndpoint ) );
path -> path.equals( "/query-api/v1.0.0" + apiEndpoint ) );
}

@ParameterizedTest
Expand Down

0 comments on commit 8f1d533

Please sign in to comment.