Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional properties don't support Json Array type #22

Open
VamshikShetty opened this issue Jul 27, 2022 · 1 comment
Open

Additional properties don't support Json Array type #22

VamshikShetty opened this issue Jul 27, 2022 · 1 comment

Comments

@VamshikShetty
Copy link
Contributor

VamshikShetty commented Jul 27, 2022

Currently OAS 3.0 spec is not in sync with server response structure and might be providing more params than mentioned in spec. To fix this issue we allowed additional properties to be created if not present as mentioned in issue #16 and committed fix in PR #18.
But when additional params are provided in form of Array rather Object or primitive type deserialisation of structure faces following exception:

Exception in thread "main" java.lang.ClassCastException: class com.google.gson.JsonArray cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonArray and com.google.gson.JsonObject are in unnamed module of loader 'app')
        at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:192)

Solution: At bare minimum we need to get Equinix OAS 3.0 closer to server response at least for array type params and in long run make sure that all the params returned by Equinix env are present in spec then we can change generated code behaviour to be strict on additional properties.

This issue will also track, list of models in Equinix OAS 3.0 which are incomplete relative to their server response as we find them.

@VamshikShetty
Copy link
Contributor Author

For Model : components/schemas/Device

List of missing params:

  1. network_frozen
  2. device_type
  3. storage
  4. allow_same_vlan_on_multiple_ports
  5. network_ports : This should be array of components/schemas/Port
  6. actions
  7. reservation_pricing

For Model : components/schemas/Plan (which is used in model Device)

  1. deployment_types
  2. available_in_metros

For Model : components/schemas/Event (which is used in model Device)

  1. ip
  2. modified_by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant