Skip to content

Commit

Permalink
fix(schemas): Sort schemas to avoid reordering while developing
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 18, 2024
1 parent ee8e8c3 commit edc241f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
2 changes: 2 additions & 0 deletions generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ foreach ($scopePaths as $scope => $paths) {

if (count($scopedSchemas) === 0) {
$scopedSchemas = new \stdClass();
} else {
ksort($scopedSchemas);
}

$openapiScope['components']['schemas'] = $scopedSchemas;
Expand Down
54 changes: 27 additions & 27 deletions tests/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,32 @@
}
},
"schemas": {
"OCSMeta": {
"Collection": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Item"
}
},
"Item": {
"type": "object",
"required": [
"status",
"statuscode"
"label",
"link",
"type",
"primary"
],
"properties": {
"status": {
"label": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"link": {
"type": "string"
},
"totalitems": {
"type": {
"type": "string"
},
"itemsperpage": {
"type": "string"
"primary": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -119,12 +124,6 @@
}
}
},
"Collection": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Item"
}
},
"NotificationAction": {
"type": "object",
"required": [
Expand All @@ -148,26 +147,27 @@
}
}
},
"Item": {
"OCSMeta": {
"type": "object",
"required": [
"label",
"link",
"type",
"primary"
"status",
"statuscode"
],
"properties": {
"label": {
"status": {
"type": "string"
},
"link": {
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"type": {
"totalitems": {
"type": "string"
},
"primary": {
"type": "boolean"
"itemsperpage": {
"type": "string"
}
}
}
Expand Down

0 comments on commit edc241f

Please sign in to comment.