Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbooms committed Apr 11, 2024
1 parent 2aed598 commit 85a5bd1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ModelGeneratorTest {
"discriminatedOneOf",
"openapi310",
"binary",
"oneOfMarkerInterface",
)

@BeforeEach
Expand Down
25 changes: 25 additions & 0 deletions src/test/resources/examples/oneOfMarkerInterface/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
openapi: 3.0.0
info:
paths:
components:
schemas:

State:
oneOf:
- $ref: '#/components/schemas/StateA'
- $ref: '#/components/schemas/StateB'

StateA:
type: object
required:
- status
properties:
status:
type: string
StateB:
type: object
required:
- mode
properties:
mode:
type: string
21 changes: 21 additions & 0 deletions src/test/resources/examples/oneOfMarkerInterface/models/Models.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package examples.oneOfMarkerInterface.models

import com.fasterxml.jackson.`annotation`.JsonProperty
import javax.validation.constraints.NotNull
import kotlin.String

public sealed interface State

public data class StateA(
@param:JsonProperty("status")
@get:JsonProperty("status")
@get:NotNull
public val status: String,
) : State

public data class StateB(
@param:JsonProperty("mode")
@get:JsonProperty("mode")
@get:NotNull
public val mode: String,
) : State

0 comments on commit 85a5bd1

Please sign in to comment.