-
Notifications
You must be signed in to change notification settings - Fork 90
Support for openapi v3/v3.1 schema formats #1291 #1494
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
Merged
sam0r040
merged 18 commits into
springwolf:master
from
tvahrst:componentschema-refactoring
Nov 21, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a92b4e5
feat: schemaformat option for payload schemas added
tvahrst 491cbd6
feat: tests for schemaformat option for payload schemas added
tvahrst 0e45567
chore: spotless
tvahrst 3122687
chore: javadoc
tvahrst 109f50e
chore: spotless
tvahrst 3c2e3dc
fix: tests
tvahrst ad80cfa
fix: tests
tvahrst f3b6093
chore(core): move wrapper logic for MultiFormatSchema to MultiFormatS…
sam0r040 1ca9a79
Merge branch 'springwolf:master' into componentschema-refactoring
tvahrst ca1b83d
chore: ModelConvertersProvider and some minor enhancements.
tvahrst f9e1ac5
chore: spotless
tvahrst 4560d69
update tests for new ModelConvertersProvider bean. Moved initializati…
tvahrst a6f63e0
feat(core): use PayloadSchemaFormat internally, switch to SchemaForma…
timonback 94c7134
Merge branch 'master' into componentschema-refactoring
timonback aba7bf7
chore: move OpenAPIv3 integration test to kafka example
timonback 014bcb9
spotless
tvahrst 051838f
refactor(core): remove PayloadSchemaFormat from API methods and use i…
sam0r040 14961f0
chore(core): fix spotless
timonback File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...ore/src/main/java/io/github/springwolf/core/asyncapi/schemas/ModelConvertersProvider.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| package io.github.springwolf.core.asyncapi.schemas; | ||
|
|
||
| import io.github.springwolf.core.configuration.properties.SpringwolfConfigProperties; | ||
| import io.swagger.v3.core.converter.ModelConverter; | ||
| import io.swagger.v3.core.converter.ModelConverters; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Provides fully prepared {@link io.swagger.v3.core.converter.ModelConverters} for openapi v3 and v3.1 | ||
| * requirements. | ||
| */ | ||
| public class ModelConvertersProvider { | ||
|
|
||
| private final SpringwolfConfigProperties springwolfConfigProperties; | ||
| private final ModelConverters converter_openapi30; | ||
| private final ModelConverters converter_openapi31; | ||
|
|
||
| public ModelConvertersProvider( | ||
| SpringwolfConfigProperties springwolfConfigProperties, List<ModelConverter> externalModelConverters) { | ||
| this.springwolfConfigProperties = springwolfConfigProperties; | ||
|
|
||
| converter_openapi30 = new ModelConverters(false); | ||
| converter_openapi31 = new ModelConverters(true); | ||
| externalModelConverters.forEach(converter_openapi30::addConverter); | ||
| externalModelConverters.forEach(converter_openapi31::addConverter); | ||
| } | ||
|
|
||
| public ModelConverters getModelConverter() { | ||
| return switch (springwolfConfigProperties.getDocket().getPayloadSchemaFormat()) { | ||
| case ASYNCAPI_V3, OPENAPI_V3 -> converter_openapi30; | ||
| case OPENAPI_V3_1 -> converter_openapi31; | ||
| }; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.