-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supported OpenApi 3.1.0 nullable changes. (#263)
* Supported OpenApi 3.1.0 nullable changes. Fabrikt will now detect of the newer 3.1.0 specification is declared and automatically downgrade any of the json schema nullable types to the previous format. EG, this: ``` NewNullableFormat: type: object required: - version properties: version: type: - string - 'null' ``` Will get converted to this: ``` NewNullableFormat: type: object required: - version properties: version: type: string nullable: true ``` * improve code
- Loading branch information
Showing
4 changed files
with
74 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
openapi: 3.1.0 | ||
components: | ||
schemas: | ||
NewNullableFormat: | ||
type: object | ||
required: | ||
- version | ||
properties: | ||
version: | ||
type: | ||
- string | ||
- 'null' | ||
description: The resolved version or `null` if there is no matching version. | ||
|
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package examples.openapi310.models | ||
|
||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
import javax.validation.constraints.NotNull | ||
import kotlin.String | ||
|
||
public data class NewNullableFormat( | ||
@param:JsonProperty("version") | ||
@get:JsonProperty("version") | ||
@get:NotNull | ||
public val version: String, | ||
) |