Skip to content

[PLAT-5255] Update openapi and update to latest #57

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

anderssjoblom-vertex
Copy link
Contributor

@anderssjoblom-vertex anderssjoblom-vertex commented Jan 27, 2025

This is still work in progress. To build this, you need to add the following change to vertex-api/src/universal/api.yml

--- a/src/universal/api.yml
+++ b/src/universal/api.yml
@@ -1030,14 +1030,14 @@ paths:
             schema:
               $ref: "./schemas/CreatePartRequest.yml"
       responses:
-        "201":
+        "200":
           description: Created Part
           content:
             "application/vnd.api+json":
               schema:
-                $ref: "./schemas/Part.yml"
-        "202":
-          $ref: "#/components/responses/Accepted"
+                oneOf:
+                  - $ref: "./schemas/Part.yml"
+                  - $ref: "./schemas/QueuedTranslationJob.yml"
         "400":
           $ref: "#/components/responses/BadRequest"
         "401":
@@ -1651,7 +1651,9 @@ paths:
           content:
             "application/vnd.api+json":
               schema:
-                $ref: "./schemas/QueuedJob.yml"
+                oneOf:
+                  - $ref: "./schemas/QueuedJob.yml"
+                  - $ref: "./schemas/SceneItem.yml"
         "301":
           $ref: "#/components/responses/MovedPermanently"
         "401":

Summary

This updates the API-Client to a major version 1.0.0 since this is a big breaking change.

This is a major update as it upgraded the openapi generator to version 7.11.0. This version will produce all the OneOf and AnyOf classes so there are no manual generation of java classes except one type: metadata values.

The metadata values doesn't have a enum type for the "type" like a "long" or "float" type and that makes the auto-generated source ignore and value for the type. There is a small modification made to the auto generated to match on the type string and also on the values.

Test Plan

Using test and clients using the library.

Release Notes

Not sure how we would indicate the breaking changes.

Possible Regressions

Not know at this point.

@anderssjoblom-vertex anderssjoblom-vertex requested a review from a team as a code owner January 27, 2025 20:19
@anderssjoblom-vertex anderssjoblom-vertex changed the title Plat 5255 update openapi [PLAT-5255] Update openapi and update to latest Jan 31, 2025
@MadisonEhlers-Vertex
Copy link
Contributor

RE> "The metadata values doesn't have a enum type for the "type" like a "long" or "float" type and that makes the auto-generated source ignore and value for the type. There is a small modification made to the auto generated to match on the type string and also on the values."

Why is this only true for metadata types and not all of the other any ofs that we have?

Copy link
Contributor

@MadisonEhlers-Vertex MadisonEhlers-Vertex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, if you've tested the anyof mappings to verify those are working.

OneOfWebhookEventSceneIncludedDataWebhookEventPartRevisionIncludedData.java \
OneOfUpdateItemToDefaultRenditionOperation.java \
OneOfSceneViewRelationshipSceneViewStateRelationship.java \
AnyOfFileRelationshipPartAssemblyRelationship.java )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it that only the Metadata types are added here? Do we need to maintain all of these AnyOf relationships?

package com.vertexvis.example;

import com.vertexvis.model.QueuedJob;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are all of these examples removed. IIRC, these were added so clients could reference these as to how to use the platform with the java client.

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

Successfully merging this pull request may close these issues.

2 participants