You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
In case API : POST /projects/{id}/ips i.e. requestIPReservation function response structure is oneOf response between IPReservation and VrfIpReservation. Response provided by server when we try to reserve public IPv4 throws following error :
Caused by: java.io.IOException: Failed deserialization for RequestIPReservation201Response: 2 classes match result, expected 1. Detailed failure message for oneOf schemas: []. JSON: {"id":"9abf77b3-705f-4d49-84fd-f8f638ec7eb0","address_family":4,"netmask":"255.255.255.252","created_at":"2022-08-02T15:51:54Z","details":null,"tags":[],"public":true,"cidr":30,"management":false,"manageable":true,"enabled":true,"global_ip":false,"customdata":{},"addon":true,"bill":true,"state":"created","project":{"href":"/metal/v1/projects/d52cf346-cd0e-4d4f-828a-29e4c5e60f72"},"project_lite":{"href":"/metal/v1/projects/d52cf346-cd0e-4d4f-828a-29e4c5e60f72"},"assignments":[],"metal_gateway":null,"requested_by":{"href":"/metal/v1/users/d5c43ee4-676d-4098-b769-23c03626f59d"},"network":"147.28.154.156","address":"147.28.154.158","gateway":"147.28.154.157","available":"/metal/v1/ips/9abf77b3-705f-4d49-84fd-f8f638ec7eb0/available","href":"/metal/v1/ips/9abf77b3-705f-4d49-84fd-f8f638ec7eb0","facility":null,"metro":{"id":"d3d6b29f-042d-43b7-b3ce-0bf53d5754ca","name":"Dallas","code":"da","country":"US"},"type":"public_ipv4"}
at com.equinix.openapi.metal.v1.model.RequestIPReservation201Response$CustomTypeAdapterFactory$1.read(RequestIPReservation201Response.java:154)
at com.equinix.openapi.metal.v1.model.RequestIPReservation201Response$CustomTypeAdapterFactory$1.read(RequestIPReservation201Response.java:88)
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
JSON response is valid against both schema i.e.IPReservation and VrfIpReservation. In case of VrfIpReservation response structure contains "vrf" param which is not marked required hence above mentioned exception occurs.
Possible fix, VrfIpReservation should be update to have required param :
Bug 2:
Response structure schema exists inline in spec hence generates following model RequestIPReservation201Response to wrap over oneOf over IPReservation and VrfIpReservation.
Related issue post #31 when parsing response after requesting a vrf ip reservation.
Error snippet: com.google.gson.JsonSyntaxException: java.io.IOException: Failed deserialization for RequestIPReservation201Response: 2 classes match result, expected 1.
Cause: when requesting a vrf IP reservation, Json validation for response containing vrf field succeeds for IPReservation schema as well since additionalProperties is enabled in the spec configuration.
In case API :
POST /projects/{id}/ips
i.e. requestIPReservation function response structure is oneOf response between IPReservation and VrfIpReservation. Response provided by server when we try to reserve public IPv4 throws following error :JSON response is valid against both schema i.e.IPReservation and VrfIpReservation. In case of VrfIpReservation response structure contains "vrf" param which is not marked required hence above mentioned exception occurs.
Possible fix, VrfIpReservation should be update to have required param :
The text was updated successfully, but these errors were encountered: