Skip to content

Commit

Permalink
Add function to determine discriminator mapping key
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikandersen committed Oct 17, 2024
1 parent 2a3ee2b commit 59bf0a9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ object KaizenParserExtensions {
}
}

fun Discriminator.mappingKeyForSchemaName(schemaName: String): String? =
mappings.filter { it.value.endsWith(schemaName) }.keys.firstOrNull()

fun Schema.isInLinedObjectUnderAllOf(): Boolean =
Overlay.of(this).pathFromRoot
.splitToSequence("/")
Expand Down

0 comments on commit 59bf0a9

Please sign in to comment.