-
Notifications
You must be signed in to change notification settings - Fork 6
fix: extending the validation rules for plans #63
fix: extending the validation rules for plans #63
Conversation
@antoninrykalsky Hi, thanks for the patch, it's really good that you've noticed that. We can't directly edit the python code becauese it's generated from the API specs docs (the yaml file in the root of the repo). We also can't edit the YAML file because it's generated from API-spec sub-files. We do these fixes via python script https://github.com/equinix-labs/metal-python/blob/main/scripts/patch_metal_spec.py As for the '100Mb' vs '100MB', I don't think we can force |
So about that upper, there is no problem about It in in that plan. Just one occurence
About nic speed, there is problem with this: (
|
For comparison, in metal-go, we patched the spec to remove these enums from plans because the data was not well-controlled; we raised that issue upstream and were told it was resolved, and I was about to remove that patch from the Go SDK, but since you're still running into issues with it, we should probably adopt the same spec patch in Python. https://github.com/equinix/equinix-sdk-go/blob/main/spec/services/metalv1/patches/20230921-plan-drive-type.patch |
@ctreatma Thanks for the clue. I've seen similar removal of the default value. I just didn't make the connection. |
) This PR removes 2 enums from Plan subschemas, because the enumed values don't match the API. Based on: https://github.com/equinix/equinix-sdk-go/blob/main/spec/services/metalv1/patches/20230921-plan-drive-type.patch fixes #63 Most of the diff are tests, the relevant changes are two entries at the bottom.
When I list all the plans, there is a problem with inserting data into the objects, due to validation rules.
In one case, the 100Gbps value is missing in the enum.
In the other, it returns 100mb instead of 100MB.
Maybe it's not specifically like this, I lost the cases in the history. I can execute it again if needed.