You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4273f4
Browse filesBrowse the repository at this point in the historyBrowse files
// for schemas with no ref, it is not possible to build the discriminator map
3706
-
// because ref is how we get the model name
3707
-
// we only hit this use case for a schema with inline composed schemas, and one of those
3708
-
// schemas also has inline composed schemas
3709
-
// Note: if it is only inline one level, then the inline model resolver will move it into its own
3710
-
// schema and make it a $ref schema in the oneOf/anyOf location
3711
-
once(LOGGER).warn(
3712
-
"Invalid inline schema defined in oneOf/anyOf in '{}'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition",
// hack: avoid infinite loop on potential self-references in event our checks fail.
3743
-
while (100000 > count++) {
3744
-
for (StringchildName : keys) {
3745
-
if (childName.equals(thisSchemaName)) {
3746
-
continue;
3747
-
}
3748
-
Schemachild = schemas.get(childName);
3749
-
if (ModelUtils.isComposedSchema(child)) {
3750
-
List<Schema> parents = child.getAllOf();
3751
-
if (parents != null) {
3752
-
for (Schemaparent : parents) {
3753
-
Stringref = parent.get$ref();
3754
-
if (ref == null) {
3755
-
// for schemas with no ref, it is not possible to build the discriminator map
3756
-
// because ref is how we get the model name
3757
-
// we hit this use case when an allOf composed schema contains an inline schema
3758
-
continue;
3759
-
}
3760
-
StringparentName = ModelUtils.getSimpleRef(ref);
3761
-
if (parentName != null && parentName.equals(currentSchemaName)) {
3762
-
if (queue.contains(childName) || descendentSchemas.stream().anyMatch(i -> childName.equals(i.getMappingName()))) {
3763
-
thrownewRuntimeException("Stack overflow hit when looking for " + thisSchemaName + " an infinite loop starting and ending at " + childName + " was seen");
0 commit comments