Improvement/traveller handling#71
Open
jorgenosberg wants to merge 4 commits intoOMSA-Open-Mobility-Sales-API:next-versionfrom
Open
Improvement/traveller handling#71jorgenosberg wants to merge 4 commits intoOMSA-Open-Mobility-Sales-API:next-versionfrom
jorgenosberg wants to merge 4 commits intoOMSA-Open-Mobility-Sales-API:next-versionfrom
Conversation
…userProfileReference
Add discriminator to travelParty with mapping for individualTraveller, userProfile, and travellingAsset. Replace separate travellers/profiles/ travellingAssets arrays with single travelParties array in input schemas and package response. Add explicit type enums to subtypes for correct code generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR serves as a PoC for how we could make traveller-handling more dev & tooling-friendly and avoid the previously discussed
travellersvs.profilesvs.assetsissue in our input schemas.By designing
TravelPartyas the top level schema with correct discriminator usage, generators are able to handle the correct subTypes. This means that devs would typically get aTravelPartyinterface with the correct implementationsIndividualTraveller,UserProfileandAsset/TravellingAsset.This also means input schemas don't need both
travellers,profilesandtravellingAssets- they can use a unifiedtravelPartiesarray.Copilot summary:
Schema standardization and consolidation:
travellersarray with atravelPartiesarray, and updated the referenced schema fromindividualTraveller/userProfile/travellingAssetto a unifiedtravelPartyschema. This change affects multiple request and response objects, ensuring consistency in how groups of travelers are handled. [1] [2] [3]updatedTravelParty(referencingtravelParty) instead ofupdatedTraveller(which previously allowed several types), further consolidating traveler-related data structures.Schema extensibility improvements:
discriminatorproperty to thetravelPartyschema, mapping type values to specific subtypes (individualTraveller,userProfile,travellingAsset). This enables polymorphic deserialization and better type safety.Reference type additions and updates:
userProfileReferenceandsimpleAssetReference, and updated relevant schemas to use these instead of generic or previous references. [1] [2] [3] [4] [5]