Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

IP reservation schema patch #43

Merged
merged 8 commits into from
Sep 14, 2022

Conversation

rinzler-17
Copy link
Contributor

Addresses #30 (comment)

@rinzler-17 rinzler-17 marked this pull request as draft September 10, 2022 17:52
@rinzler-17
Copy link
Contributor Author

Patch 12 keynotes:

  1. Declared a parent schema called IPReservation which is extended by DefaultIPReservation (for regular equinix ip reservations) and VrfIPReservation (for vrf only ip reservations).
  2. All 3 schemas for ip reservation are complete including all possible property fields cross referenced from API tests. additionalProperties was set to false in the child schema because of a bug in oas3.0 due to which the member field additionalProperties gets duplicated in child classes. This flagged runtime errors when instantiating class from Json response objects.
  3. For responses containing the IPReservation schema-reference, JSON validation occurs during the parsing step based on the discriminator configuration specified in IPReservation. The subclass is decided by the required field type.
  4. GET API responses for MetalGateway and VrfMetalGateway were basically the same with only vrf field being null in the former. Hence, VrfMetalGateway was removed from the spec and its usage was replaced by MetalGateway after adding a vrf property to the MetalGateway schema.

Note: 1, 2 and 3 overwrite some spec changes from patch 10.

@rinzler-17 rinzler-17 marked this pull request as ready for review September 12, 2022 05:55
@rinzler-17 rinzler-17 changed the title 10 ip reservation schema patch IP reservation schema patch Sep 12, 2022
@displague displague merged commit 6fda6b0 into equinix-labs:main Sep 14, 2022
@displague
Copy link
Member

I've created an upstream patch for the added fields. I'm not upstreaming the base class changes at this time, it would not be conventional with the API spec so there is more to consider there.

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

Successfully merging this pull request may close these issues.

2 participants