MaximilianKoestler / hcloud-openapi

This is the unofficial OpenAPI description of the Hetzner Cloud API. It allows automatic code generation for the hcloud API.
MIT License
29 stars 4 forks source link

Error: Found transformation with invalid path: components/schemas/metrics/properties/time_series #29

Closed egze closed 2 weeks ago

egze commented 3 months ago

I cloned the repo and ran the example command, then got this:

> npm run convert -- --output openapi/hcloud.json

> hcloud-openapi@1.0.0 convert
> ts-node ./src/index.ts --output openapi/hcloud.json

Loading JSON from https://docs.hetzner.cloud/spec.json
Overwriting existing schema description label_selector ("Configuration for type LabelSelector, required if type is `label_selector` | Configuration for type label_selector, required if type is `label_selector` | Label selector used to determine targets. Only present for target type "label_selector". | Configuration for label selector targets, required if type is `label_selector`" -> "Configuration for type LabelSelector, required if type is `label_selector`)"
Overwriting existing schema description protection ("Protection configuration for the Resource." -> "Protection configuration for the Resource)"
Overwriting existing schema description ip_type ("Type of the Floating IP | Floating IP type | The type of the Floating IP | The type of the Primary IP | Type of the Primary IP | Primary IP type" -> "The type of the IP)"
Overwriting existing schema description load_balancer_service ("Request for POST https://api.hetzner.cloud/v1/load_balancers/{id}/actions/add_service" -> "A service for a Load Balancer.)"
Overwriting existing schema description update_load_balancer_service ("Request for POST https://api.hetzner.cloud/v1/load_balancers/{id}/actions/update_service" -> "An update to a service for a Load Balancer.)"
Overwriting existing schema description subnet ("Request for POST https://api.hetzner.cloud/v1/networks/{id}/actions/add_subnet" -> "Subnets divide the ip_range from the parent Network object into multiple Subnetworks that you can use for different specific purposes.)"
Found 17 component entries which only occur once
Error: Found transformation with invalid path: components/schemas/metrics/properties/time_series
    at applyTransformation (/Users/aaa/src/hcloud-openapi/src/document/transformation.ts:20:11)
    at /Users/aaa/src/hcloud-openapi/src/document/transformation.ts:60:5
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/aaa/src/hcloud-openapi/src/document/transformation.ts:59:19)
    at Generator.next (<anonymous>)
    at fulfilled (/Users/aaa/src/hcloud-openapi/src/document/transformation.ts:5:58)

Is this a bug?

MaximilianKoestler commented 3 months ago

Hello @egze , this project is following the upstream documentation/spec file at https://docs.hetzner.cloud/spec.json . Sometimes Hetzner performs big changes on their side which break the very manual processing done by the scripts in this repo.

I unfortunately fell a bit behind in the recent months due to time constraints on my side and Hetzner has done some substantial refactoring on their side. I should be able to update and fix the scripts in the upcoming weeks though.

Regarding a more long-term perspective, Hetzner is now introducing components into their own spec file and they also maintain a proper change log now. So I foresee that my project will get deprecated in the near future as it does not bring major benefits over the upstream spec. How long I keep this repo alive depends on how long we need it for hcloud-rust, to my knowledge the only downstream project that uses my spec and the reason why I started building an OpenAPI document for the Hetzner API in the first place.

MaximilianKoestler commented 2 weeks ago

I updated the spec to the current version from Hetzner, all should be working now again.