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

feat: API Sync by GitHub Action (2023-08-15) #110

Closed
wants to merge 5 commits into from

Conversation

github-actions[bot]
Copy link
Contributor

This API Sync PR was automated through GitHub Actions workflow_displatch
on 2023-08-15.

  • latest Swagger is fetched
  • patches have been applied
  • generated client has been updated

@github-actions
Copy link
Contributor Author

Failed to generate code from latest patched spec. Someone with write access must fix this PR manually and then convert it from Draft status to Ready for Review.

@displague
Copy link
Member

displague commented Aug 15, 2023

for diff in patches/spec.fetched.json/05-remove-because-java-generator-lack-of-support-for-primitive-anyof.patch patches/spec.fetched.json/08-make-vrf-required-param-in-vrf-metal-gateway.patch patches/spec.fetched.json/09-set-additional-prop-to-false-in-href.patch patches/spec.fetched.json/20230407-Device-schema-HwReservation-or-href.patch; do \
	patch --no-backup-if-mismatch -N -t -p1 -i $diff; \
done
patching file spec/oas3.patched/openapi/public/components/schemas/FacilityInput.yaml
Hunk #1 succeeded at 11 (offset 1 line).
patching file spec/oas3.patched/openapi/public/components/schemas/IPReservationOrHref.yaml
patching file spec/oas3.patched/openapi/public/components/schemas/MetalGateway.yaml
patching file spec/oas3.patched/openapi/public/components/schemas/MetalGatewayList.yaml
Hunk #1 succeeded at 2 with fuzz 2.
patching file spec/oas3.patched/openapi/public/components/schemas/VrfIpReservationOrHref.yaml
patching file spec/oas3.patched/openapi/public/components/schemas/VrfMetalGateway.yaml
patching file spec/oas3.patched/openapi/public/components/schemas/Href.yaml
patching file spec/oas3.patched/openapi/public/components/schemas/Device.yaml
[main a163723] sync: apply patches to 2023-08-15 spec 18 files changed, 1[9](https://github.com/equinix-labs/metal-java/actions/runs/5871156270/job/15919829071#step:6:10)3 insertions(+), 39 deletions(-) create mode [10](https://github.com/equinix-labs/metal-java/actions/runs/5871156270/job/15919829071#step:6:11)0644 spec/oas3.patched/openapi/public/components/schemas/DedicatedPortCreateInput.yaml create mode 100644 spec/oas3.patched/openapi/public/components/schemas/VlanFabricVcCreateInput.yaml rename spec/oas3.patched/openapi/public/components/schemas/{InterconnectionCreateInput.yaml => VrfFabricVcCreateInput.yaml} (54%)
Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/metal-java/metal-java/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/InterconnectionsApiTest.java:[74,89] error: incompatible types: InterconnectionCreateInput cannot be converted to CreateOrganizationInterconnectionRequest
Error:  /home/runner/work/metal-java/metal-java/equinix-openapi-metal/src/test/java/com/equinix/openapi/metal/v1/api/InterconnectionsApiTest.java:[91,79] error: incompatible types: InterconnectionCreateInput cannot be converted to CreateOrganizationInterconnectionRequest

@displague displague marked this pull request as ready for review August 15, 2023 22:45
@displague
Copy link
Member

displague commented Aug 15, 2023

@cprivitere and I walked through this and made this change to the InterconnectionApiTest with the intent to address the failing test message:

incompatible types: InterconnectionCreateInput cannot be converted to CreateOrganizationInterconnectionRequest

It seems that the openapitools-generator may have a blindspot to requestBodies with oneOf schema bodies. Java is neither of our strong suits, so we're not sure. The tests pass with this change, but the change to use CreateOrganizationInterconnectionRequest may be incorrect. We're not sure how to trigger the TypeAdapterFactory for the abstract (generic?) type InterconnectionCreateInput in the correct way. Using CreateOrganizationInterconnectionRequest may be the wrong type, but since the value used for testing is null, maybe it doesn't matter?

@displague
Copy link
Member

We noticed that one of the OAS3 changes introduced createOrganizationInterconnection_request which has an unusual naming pattern.

@displague
Copy link
Member

Also, we didn't see any issues pop-out based on our searches

@cprivitere
Copy link
Contributor

My local environment was JDK 20 and if I ran make docker_run twice, it'd work. Our CI is JDK 11, however, so I'm working on setting up a JDK 11 local environment to get a better test.

It would be good to know if folks would like to move to the newer LTS of 17 or not, as I'm not sure how we arrived at using 11.

displague added a commit that referenced this pull request Aug 16, 2023
Add delete_failed enum to InterconnectionPort.yaml to support upstream
API change detected in #110
@cprivitere cprivitere closed this Aug 16, 2023
@cprivitere cprivitere deleted the sync/gh-1692129641 branch August 16, 2023 20:22
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