mirror of https://github.com/halo-dev/halo
Fix the problem of inconsistent OpenAPI generation (#3954)
#### What type of PR is this? /kind bug /area core /milestone 2.6.x #### What this PR does / why we need it: Sort properties before building. #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3944 #### Special notes for your reviewer: Try to generate api client several times. #### Does this PR introduce a user-facing change? ```release-note None ```pull/3941/head
parent
136bd4e91f
commit
88597ac137
|
@ -40,7 +40,11 @@ public final class QueryParamBuildUtil {
|
|||
var properties = (Map<String, Schema>) resolvedSchema.schema.getProperties();
|
||||
var requiredNames = defaultIfNull(resolvedSchema.schema.getRequired(),
|
||||
Collections.emptyList());
|
||||
properties.forEach((propName, propSchema) -> {
|
||||
properties.keySet()
|
||||
.stream()
|
||||
.sorted()
|
||||
.forEach(propName -> {
|
||||
var propSchema = properties.get(propName);
|
||||
final var paramBuilder = parameterBuilder().in(ParameterIn.QUERY);
|
||||
paramBuilder.name(propSchema.getName())
|
||||
.description(propSchema.getDescription())
|
||||
|
|
Loading…
Reference in New Issue