Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API docs reference resolution #1442

Merged
merged 17 commits into from
Dec 20, 2024
Merged

Conversation

t-burch
Copy link
Collaborator

@t-burch t-burch commented Dec 19, 2024

No description provided.

t-burch and others added 5 commits November 25, 2024 16:11
- Create a new test class `OpenAPI31ReferencesTest` for validating OpenAPI 3.1 references.
- Implement setup method to initialize the router and load OpenAPI specs.
- Update test cases to handle requests for both `/pets` and `/users` endpoints.
- Modify the existing OpenAPI specification to include server information in the YAML configuration.
…ptor

- Import Json31 from Swagger library
- Serialize OpenAPI records to JSON bytes in returnOpenApiAsYaml method
- Update XML configuration to reference OpenAPI specification location
- Modify `OpenAPIPublisherInterceptor` to serialize rewritten OpenAPI record to YAML response.
- Update `OpenAPIRecordFactory` to create `OpenAPIRecord` using parsed `OpenAPI` objects.
- Add `getSpec()` method to convert `OpenAPI` to `JsonNode` for schema retrieval.
- Adjust XML configuration to reference OpenAPI specification files correctly.
@membrane-ci-server
Copy link

This pull request needs "/ok-to-test" from an authorized committer.

@t-burch t-burch marked this pull request as draft December 19, 2024 13:59
Improve the `create` methods in `OpenAPIRecordFactory` by obtaining `OpenAPI` instances before initializing `OpenAPIRecord`. Simplify `getSpec` to accept `OpenAPI` instead of `OpenAPISpec` and streamline JSON conversion.
…actory

- Implement tests to verify that Swagger 2.0 descriptions include a conversion notice when transformed to OAS 3.0.
- Add a test to ensure that if an existing description is present, the conversion notice is appended without overwriting.
- Confirm that OpenAPI 3 specifications do not receive a conversion notice.
- Enhance the OpenAPIRecordFactory to check for Swagger 2 format and add the appropriate conversion notice in the API's description upon reading specifications.
Update OpenAPIRecordFactory to use an InputStream for loading OpenAPI specifications instead of a URL. Adjust tests to reflect changes in file names and descriptions for better clarity and consistency.
@t-burch t-burch marked this pull request as ready for review December 20, 2024 09:30
@t-burch
Copy link
Collaborator Author

t-burch commented Dec 20, 2024

/ok-to-test

@predic8
Copy link
Member

predic8 commented Dec 20, 2024

Note: This OpenAPI description was converted from Swagger 2 to OAS 3 by Membrane API Gateway!

@predic8
Copy link
Member

predic8 commented Dec 20, 2024

      <api port="2000">
<!--            <openapi dir="conf"/>-->
            <openapi location="../../core/src/test/resources/openapi/specs/fruitshop-swagger-2.0.json"/>
            <openapi location="../../core/src/test/resources/openapi/specs/oas31/request-reference.yaml"/>
        </api>

… readability. Update tests to ensure correct description handling and modify HTML overview to display original Swagger version if available.
…ption was converted from Swagger 2 to OAS 3 by the Membrane API Gateway.
t-burch and others added 3 commits December 20, 2024 14:41
…tests

- Remove deprecated methods and tests related to Swagger 2.
- Simplify OpenAPI version handling and improve code clarity.
- Update OpenAPIUtil to include method for converting OpenAPI to JSON format.
- Adjust related tests for OpenAPI 3 compatibility.
@t-burch t-burch requested a review from predic8 December 20, 2024 14:31
@predic8 predic8 merged commit 8904f21 into master Dec 20, 2024
3 of 4 checks passed
@predic8 predic8 deleted the #1360-api-docs-reference-resolution branch December 20, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants