Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #4676 - fix schema serialization with sort=true #4677

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.swagger.v3.core.filter.SpecFilter;
import io.swagger.v3.core.jackson.ModelResolver;
import io.swagger.v3.core.jackson.PathsSerializer;
import io.swagger.v3.core.jackson.mixin.Schema31Mixin;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.core.util.Json31;
import io.swagger.v3.core.util.Yaml;
Expand Down Expand Up @@ -739,7 +740,62 @@ static abstract class SortedSchemaMixin {
@JsonIgnore
public abstract Object getJsonSchemaImpl();

@JsonIgnore
public abstract List<Schema> getPrefixItems();

@JsonIgnore
public abstract String getContentEncoding();

@JsonIgnore
public abstract String getContentMediaType();

@JsonIgnore
public abstract Schema getContentSchema();

@JsonIgnore
public abstract Schema getPropertyNames();

@JsonIgnore
public abstract Object getUnevaluatedProperties();

@JsonIgnore
public abstract Integer getMaxContains();

@JsonIgnore
public abstract Integer getMinContains();

@JsonIgnore
public abstract Schema getAdditionalItems();

@JsonIgnore
public abstract Schema getUnevaluatedItems();

@JsonIgnore
public abstract Schema getIf();

@JsonIgnore
public abstract Schema getElse();

@JsonIgnore
public abstract Schema getThen();

@JsonIgnore
public abstract Map<String, Schema> getDependentSchemas();

@JsonIgnore
public abstract Map<String, List<String>> getDependentRequired();

@JsonIgnore
public abstract String get$comment();

@JsonIgnore
public abstract List<Object> getExamples();

@JsonIgnore
public abstract Object getConst();

@JsonIgnore
public abstract Boolean getBooleanSchemaValue();
}

@JsonPropertyOrder(value = {"openapi", "info", "externalDocs", "servers", "security", "tags", "paths", "components", "webhooks"}, alphabetic = true)
Expand All @@ -756,7 +812,7 @@ static abstract class SortedOpenAPIMixin31 {
public abstract Paths getPaths();
}

@JsonPropertyOrder(value = {"type", "format"}, alphabetic = true)
@JsonPropertyOrder(value = {"type", "format", "if", "then", "else"}, alphabetic = true)
static abstract class SortedSchemaMixin31 {

@JsonAnyGetter
Expand Down Expand Up @@ -785,6 +841,7 @@ static abstract class SortedSchemaMixin31 {
public abstract String getType();

@JsonProperty("type")
@JsonSerialize(using = Schema31Mixin.TypeSerializer.class)
public abstract Set<String> getTypes();

@JsonAnySetter
Expand All @@ -799,6 +856,9 @@ static abstract class SortedSchemaMixin31 {
@JsonIgnore
public abstract Object getJsonSchemaImpl();

@JsonIgnore
public abstract Boolean getBooleanSchemaValue();

}

}
Loading