Skip to content

Commit

Permalink
[dart] [dart-dio] Support OpenAPI 3.1 composed schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
jutuon committed Jan 15, 2025
1 parent 760d5e8 commit 33f2ce5
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.common.collect.Sets;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.ComposedSchema;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.servers.Server;
Expand Down Expand Up @@ -593,7 +592,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) {

// Handle composed properties and it's NOT allOf with a single ref only
if (ModelUtils.isComposedSchema(p) && !(ModelUtils.isAllOf(p) && p.getAllOf().size() == 1)) {
ComposedSchema composed = (ComposedSchema) p;
Schema<Object> composed = (Schema<Object>) p;

// Count the occurrences of allOf/anyOf/oneOf with exactly one child element
long count = Stream.of(composed.getAllOf(), composed.getAnyOf(), composed.getOneOf())
Expand Down

0 comments on commit 33f2ce5

Please sign in to comment.