update openapi to 3.1.0 - #545
Conversation
There was a problem hiding this comment.
Sorry @slashburygin, your pull request is larger than the review limit of 150000 diff characters
Reviewer's GuideThis PR upgrades the project’s OpenAPI specifications and generation flow to support both OpenAPI 3.0.3 and 3.1.0, adds new 3.1.0-compliant specs for boot/orch/status/user APIs, refactors schema/tag/operation naming around VM-centric resources, and updates the manual OpenAPI test to fetch and write out versioned specification files. Entity relationship diagram for VM-centric resources in updated OpenAPI specserDiagram
VM {
string uuid
string name
string state
string status
}
Port {
string uuid
string mac
string vm
}
IpAddress {
string uuid
string ip
string port
}
Tag {
string uuid
string name
string vm
}
VM ||--o{ Port : has
Port ||--o{ IpAddress : has
VM ||--o{ Tag : has
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| properties: {} | ||
| default: | ||
| $ref: '#/components/responses/Error' | ||
| operationId: Get_OpenApi_specification |
There was a problem hiding this comment.
This operationId is duplicated by the 3.0.3 specification endpoint in the same document. Please include the OpenAPI version in the operationId (for example, Get_OpenApi_specification_3_1_0) so client generators can consume the spec.
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Unknown_Create' |
There was a problem hiding this comment.
Unknown_Create is referenced here, but no matching schema is emitted under components.schemas. This makes the generated OpenAPI document invalid and prevents client generation. Please either emit the schema or omit this placeholder route from the published specification.
| info: | ||
| title: Exordos Core v1 Boot API | ||
| title: REST API Microservice |
There was a problem hiding this comment.
This file is the published Boot API reference, but this update replaces its service metadata and route surface with the functional-test fixture: it now advertises REST API Microservice, localhost, and VM test routes that boot_api does not expose. Please generate these docs from the actual service contract, or keep the test fixture output out of docs/openapi.
| type: integer | ||
| description: The HTTP status code | ||
| minimum: 400 | ||
| exclusiveMaximum: true |
There was a problem hiding this comment.
This document is now declared as OpenAPI 3.1, where exclusiveMaximum must be a numeric boundary rather than a boolean. The current true value makes the schema invalid for 3.1 tooling. Please remove it or express the intended numeric constraint with the 3.1 syntax.
| for version in OPENAPI_VERSIONS: | ||
| url = f"{user_api.get_endpoint()}{SPECIFICATIONS_PATH}{version}" | ||
| response = client.get(url, timeout=30) | ||
| assert response.status_code == 200 |
There was a problem hiding this comment.
A 200 response only proves that the endpoint is reachable; the document is then written without any OpenAPI validation. That allowed the invalid specs in this change to be committed. Please validate each generated document before writing it, including unique operationIds and resolvable component references.
| - name: functional-test | ||
| description: Just functional tests | ||
| externalDocs: | ||
| url: https://https://functional.tests/docs/ |
There was a problem hiding this comment.
The generated externalDocs URL has the scheme twice, so it resolves to an invalid destination. This same malformed value is present in all generated specs; please correct the source metadata before publishing the documents.
| minLength: 0 | ||
| maxLength: 10 | ||
| example: any_string | ||
| default: off |
There was a problem hiding this comment.
state is declared as a string, but unquoted off is parsed by YAML consumers as boolean false. This makes the default type-invalid throughout the generated spec. Please emit it as a quoted string ("off") in every affected schema and parameter.
phantomii
left a comment
There was a problem hiding this comment.
Changes requested: the generated OpenAPI documents need to be corrected and validated before merge. See the inline review comments for the required fixes.
Summary by Sourcery
Update OpenAPI specifications and test harness to support both 3.0.3 and 3.1.0 versions, enriching metadata and expanding VM-related schemas and endpoints across user, boot, status, and orchestration APIs.
Enhancements:
Tests: