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

Java: adds sealed boxed classes for validated Schema payloads #389

Merged
merged 48 commits into from
Feb 10, 2024

Conversation

spacether
Copy link
Contributor

@spacether spacether commented Feb 7, 2024

Java:

  • Schemas: adds sealed validated payload boxed class for each schema, method validateAndBox creates instances of it
    • these classes are boxed because the data property always holds the validated payload
  • those sealed classes will be used as inputs for request bodies, this prevents duplicating the validate interfaces in the request body classes. If this weren't done, then 6 or more validate interfaces would need to be generated in the requestbody for the validate methods. 6 or more comes from 6 json schema types and the more includes enum types.
  • adds templates that will be used in future request body work
  • schema docs updated to list the sealed class, implementing classes, and the new validateAndBox methods

Future Work

  • generate RequestBody classes and use the sealed schema classes in them

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    mvn clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/python*.
    For Windows users, please run the script in Git BASH.

@spacether spacether marked this pull request as draft February 7, 2024 23:35
@spacether spacether force-pushed the java_adds_requestBody branch from 87f922c to 8a7ed6d Compare February 8, 2024 00:21
@spacether spacether changed the title Java, adds RequestBody Java: adds sealed boxed Schema classes, adds RequestBody Feb 8, 2024
@spacether spacether added the java Pull requests that update Java code label Feb 8, 2024
@spacether spacether changed the title Java: adds sealed boxed Schema classes, adds RequestBody Java: adds sealed boxed Schema classes Feb 8, 2024
@spacether spacether changed the title Java: adds sealed boxed Schema classes Java: adds sealed boxed classes for validated Schema payloads Feb 10, 2024
@spacether spacether marked this pull request as ready for review February 10, 2024 04:08
@spacether spacether merged commit 8fecced into master Feb 10, 2024
@spacether spacether deleted the java_adds_requestBody branch February 10, 2024 04:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
java Pull requests that update Java code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant