[PLAT-6843] -- Update to the current vertex-api spec and current openapi generator (v7.14.0)#63
Conversation
|
| /** | ||
| * Custom Java client codegen that supports conditional validation skipping. | ||
| */ | ||
| public class VertexJavaClientCodegen extends JavaClientCodegen implements CodegenConfig { |
There was a problem hiding this comment.
Customization to exclude models from validation.
| @@ -0,0 +1 @@ | |||
| com.vertexvis.codegen.VertexJavaClientCodegen | |||
There was a problem hiding this comment.
register the generator extension
| {{^vendorExtensions.x-skip-validation}} | ||
| validateJsonElement(jsonElement); | ||
| {{/vendorExtensions.x-skip-validation}} | ||
| {{#vendorExtensions.x-skip-validation}} | ||
| // vertex:TODO: Skipping validation during deserialization of the JSON element based on configuration | ||
| // validateJsonElement(jsonElement); | ||
| {{/vendorExtensions.x-skip-validation}} |
There was a problem hiding this comment.
Conditional validation based on the skip validation extension
|
|
||
| src/main/AndroidManifest.xml | ||
| src/test/ | ||
| **/auth/RetryingOAuth.java |
There was a problem hiding this comment.
Use the custom RetryingOAuth
| useRuntimeException: "true", | ||
| ] | ||
| additionalProperties = [ | ||
| skipValidationFor: "Part,PartData,PartDataAttributes,QueuedJobData,QueuedJob,QueuedJobDataAttributes" // Comma-separated list of models to skip validation for |
There was a problem hiding this comment.
here is where we specify classes to skip validation for. As we update vertex-api, these can be removed
|
|
||
| public void setFlow(OAuthFlow flow) { | ||
| if (flow == OAuthFlow.application) { | ||
| if (flow == OAuthFlow.APPLICATION) { |
There was a problem hiding this comment.
latest version changed this to all caps
mikemccarty-vertex
left a comment
There was a problem hiding this comment.
impressive!
Have you tested the output against one of our repos?
Only locally against the shared parts library tests repo. I'll need to PR that one once this one is published...The way this is published, it's not clear to me how to get a "snapshot" version like we can with our other libs that use vertex-maven-gradle-plugin |
|
I'm anticipating that the publishing won't work due to the current configuration. So I will open a new PR to address that if it fails to publish a new artifact on this merge. |



Summary
Updating the Java client to the latest vertex-api spec faced critical OpenAPI generator issues:
v5.4.0: Broken AnyOf/OneOf handling requiring manual workarounds
v7.14.0: Fixed AnyOf/OneOf but broke POST /parts and POST /scene-items endpoints due to multiple return type limitations.
This PR implements a custom OpenAPI generator with multi-module gradle project to resolve compatibility issues while upgrading to the latest tooling.
Multi-Module gradle projects
openapi-generator-plugin: Custom generator extending v7.14.0 with template modificationsapi-client-library: Generated client using custom generator with selective validation skippingexamples: Demonstration applications moved to dedicated moduleCustom Generator Implementation
pojo.mustachetemplate to support "skip validation" configurationPart,PartData,PartDataAttributes,QueuedJobData,QueuedJob,QueuedJobDataAttributesCode Cleanup
Test Plan
Release Notes
Possible Regressions
Dependencies
Ticket
NOTES
Updated one of the examples for now to test as well as published locally and tested locally with the shared parts library tests. Will update that repo once this is published