forked from springwolf/springwolf-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor/use asyncapi headers schema (springwolf#658)
* refactor(core): switch to asyncapi headers * refactor(core): remove unused jackson-annotations dependency
- Loading branch information
Showing
24 changed files
with
200 additions
and
177 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
32 changes: 0 additions & 32 deletions
32
...rc/main/java/io/github/springwolf/core/asyncapi/components/headers/AsyncHeaderSchema.java
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...ore/src/main/java/io/github/springwolf/core/asyncapi/components/headers/AsyncHeaders.java
This file was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
.../main/java/io/github/springwolf/core/asyncapi/components/headers/AsyncHeadersBuilder.java
This file contains 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.springwolf.core.asyncapi.components.headers; | ||
|
||
import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; | ||
|
||
public interface AsyncHeadersBuilder { | ||
AsyncHeaders buildHeaders(Class<?> payloadType); | ||
SchemaObject buildHeaders(Class<?> payloadType); | ||
} |
18 changes: 15 additions & 3 deletions
18
...java/io/github/springwolf/core/asyncapi/components/headers/AsyncHeadersNotDocumented.java
This file contains 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 |
---|---|---|
@@ -1,16 +1,28 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.springwolf.core.asyncapi.components.headers; | ||
|
||
import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class AsyncHeadersNotDocumented implements AsyncHeadersBuilder { | ||
/** | ||
* Per default, if no headers are explicitly defined, {@link AsyncHeadersNotUsed#NOT_USED} is used. | ||
* There can be headers, but don't have to be. | ||
*/ | ||
public static final AsyncHeaders NOT_DOCUMENTED = | ||
new AsyncHeaders("HeadersNotDocumented", "There can be headers, but they are not explicitly documented."); | ||
public static final SchemaObject NOT_DOCUMENTED = new SchemaObject(); | ||
|
||
static { | ||
NOT_DOCUMENTED.setType("object"); | ||
NOT_DOCUMENTED.setTitle("HeadersNotDocumented"); | ||
NOT_DOCUMENTED.setDescription("There can be headers, but they are not explicitly documented."); | ||
NOT_DOCUMENTED.setProperties(Map.of()); | ||
NOT_DOCUMENTED.setExamples(List.of(new Object())); | ||
} | ||
|
||
@Override | ||
public AsyncHeaders buildHeaders(Class<?> payloadType) { | ||
public SchemaObject buildHeaders(Class<?> payloadType) { | ||
return NOT_DOCUMENTED; | ||
} | ||
} |
17 changes: 15 additions & 2 deletions
17
.../main/java/io/github/springwolf/core/asyncapi/components/headers/AsyncHeadersNotUsed.java
This file contains 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 |
---|---|---|
@@ -1,14 +1,27 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package io.github.springwolf.core.asyncapi.components.headers; | ||
|
||
import io.github.springwolf.asyncapi.v3.model.schema.SchemaObject; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class AsyncHeadersNotUsed implements AsyncHeadersBuilder { | ||
/** | ||
* Explicitly document that no headers are used. | ||
*/ | ||
public static final AsyncHeaders NOT_USED = new AsyncHeaders("HeadersNotUsed", "No headers are present."); | ||
public static final SchemaObject NOT_USED = new SchemaObject(); | ||
|
||
static { | ||
NOT_USED.setType("object"); | ||
NOT_USED.setTitle("HeadersNotUsed"); | ||
NOT_USED.setDescription("No headers are present."); | ||
NOT_USED.setProperties(Map.of()); | ||
NOT_USED.setExamples(List.of(new Object())); | ||
} | ||
|
||
@Override | ||
public AsyncHeaders buildHeaders(Class<?> payloadType) { | ||
public SchemaObject buildHeaders(Class<?> payloadType) { | ||
return NOT_USED; | ||
} | ||
} |
This file contains 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 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 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
Oops, something went wrong.