From 3e3f1f5bb7bed02fbb0c0bdccb5b353c5e8da98e Mon Sep 17 00:00:00 2001 From: HavenDV Date: Wed, 5 Jun 2024 11:08:35 +0400 Subject: [PATCH] fix: Fixed bug with nullable enums. --- .../OpenApiGenerator.Core/Generation/Data.cs | 20 +- .../Generation/Sources.JsonConverters.Enum.cs | 68 +++++++ ...TestEnumNullableJsonStringEnumConverter.cs | 49 +++++ src/libs/OpenApiGenerator/SdkGenerator.cs | 15 ++ .../SystemTextJson/_#G.Api.g.verified.cs | 20 ++ ...verters.ImportStatusNullable.g.verified.cs | 57 ++++++ ...tStatusForOrgExcludeNullable.g.verified.cs | 57 ++++++ ...onsListForOrgExcludeNullable.g.verified.cs | 57 ++++++ ...ferenceRequestUseLfsNullable.g.verified.cs | 57 ++++++ ...edUserRequestExcludeNullable.g.verified.cs | 57 ++++++ ...ForOrgRequestExcludeNullable.g.verified.cs | 57 ++++++ ...tartImportRequestVcsNullable.g.verified.cs | 57 ++++++ ...dateImportRequestVcsNullable.g.verified.cs | 57 ++++++ ...erters.PageBuildTypeNullable.g.verified.cs | 57 ++++++ ...ProtectedDomainStateNullable.g.verified.cs | 57 ++++++ ...onverters.PageStatusNullable.g.verified.cs | 57 ++++++ ...ttpsCertificateStateNullable.g.verified.cs | 57 ++++++ ...ryMergeCommitMessageNullable.g.verified.cs | 57 ++++++ ...toryMergeCommitTitleNullable.g.verified.cs | 57 ++++++ ...shMergeCommitMessageNullable.g.verified.cs | 57 ++++++ ...uashMergeCommitTitleNullable.g.verified.cs | 57 ++++++ ...vancedSecurityStatusNullable.g.verified.cs | 57 ++++++ ...ecurityUpdatesStatusNullable.g.verified.cs | 57 ++++++ ...PushProtectionStatusNullable.g.verified.cs | 57 ++++++ ...SecretScanningStatusNullable.g.verified.cs | 57 ++++++ .../SystemTextJson/_#G.Api.g.verified.cs | 2 + ...ters.AsnResponseTypeNullable.g.verified.cs | 57 ++++++ ...nverters.CompanyTypeNullable.g.verified.cs | 57 ++++++ .../SystemTextJson/_#G.Api.g.verified.cs | 2 + ...chemaExtendedRunTypeNullable.g.verified.cs | 57 ++++++ ...nCreateSchemaRunTypeNullable.g.verified.cs | 57 ++++++ .../SystemTextJson/_#G.Api.g.verified.cs | 6 + ...eModelResponseStatusNullable.g.verified.cs | 57 ++++++ ...pletionRequestFormatNullable.g.verified.cs | 57 ++++++ ...pletionRequestFormatNullable.g.verified.cs | 57 ++++++ ...nverters.MessageRoleNullable.g.verified.cs | 57 ++++++ ...lModelResponseStatusNullable.g.verified.cs | 57 ++++++ ...hModelResponseStatusNullable.g.verified.cs | 57 ++++++ .../_#G.OpenAiClient.g.verified.cs | 170 +++++++++++++++++ ...ssistantObjectObjectNullable.g.verified.cs | 57 ++++++ ...ObjectResponseFormatNullable.g.verified.cs | 57 ++++++ ...sistantToolsCodeTypeNullable.g.verified.cs | 57 ++++++ ...tToolsFileSearchTypeNullable.g.verified.cs | 57 ++++++ ...antToolsFunctionTypeNullable.g.verified.cs | 57 ++++++ ...piResponseFormatTypeNullable.g.verified.cs | 57 ++++++ ...sNamedToolChoiceTypeNullable.g.verified.cs | 57 ++++++ ...nverters.BatchObjectNullable.g.verified.cs | 57 ++++++ ...chRequestInputMethodNullable.g.verified.cs | 57 ++++++ ...nverters.BatchStatusNullable.g.verified.cs | 57 ++++++ ...ageToolCallChunkTypeNullable.g.verified.cs | 57 ++++++ ...nMessageToolCallTypeNullable.g.verified.cs | 57 ++++++ ...nNamedToolChoiceTypeNullable.g.verified.cs | 57 ++++++ ...AssistantMessageRoleNullable.g.verified.cs | 57 ++++++ ...tFunctionMessageRoleNullable.g.verified.cs | 57 ++++++ ...tImageImageUrlDetailNullable.g.verified.cs | 57 ++++++ ...ContentPartImageTypeNullable.g.verified.cs | 57 ++++++ ...eContentPartTextTypeNullable.g.verified.cs | 57 ++++++ ...estSystemMessageRoleNullable.g.verified.cs | 57 ++++++ ...questToolMessageRoleNullable.g.verified.cs | 57 ++++++ ...questUserMessageRoleNullable.g.verified.cs | 57 ++++++ ...nResponseMessageRoleNullable.g.verified.cs | 57 ++++++ ...eamResponseDeltaRoleNullable.g.verified.cs | 57 ++++++ ...atCompletionToolTypeNullable.g.verified.cs | 57 ++++++ ...ssistantRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...uestCompletionWindowNullable.g.verified.cs | 57 ++++++ ...BatchRequestEndpointNullable.g.verified.cs | 57 ++++++ ...eChoicesFinishReasonNullable.g.verified.cs | 57 ++++++ ...nctionResponseObjectNullable.g.verified.cs | 57 ++++++ ...nRequestFunctionCallNullable.g.verified.cs | 57 ++++++ ...mpletionRequestModelNullable.g.verified.cs | 57 ++++++ ...stResponseFormatTypeNullable.g.verified.cs | 57 ++++++ ...ionRequestToolChoiceNullable.g.verified.cs | 57 ++++++ ...eChoicesFinishReasonNullable.g.verified.cs | 57 ++++++ ...letionResponseObjectNullable.g.verified.cs | 57 ++++++ ...eChoicesFinishReasonNullable.g.verified.cs | 57 ++++++ ...StreamResponseObjectNullable.g.verified.cs | 57 ++++++ ...mpletionRequestModelNullable.g.verified.cs | 57 ++++++ ...eChoicesFinishReasonNullable.g.verified.cs | 57 ++++++ ...letionResponseObjectNullable.g.verified.cs | 57 ++++++ ...equestEncodingFormatNullable.g.verified.cs | 57 ++++++ ...mbeddingRequestModelNullable.g.verified.cs | 57 ++++++ ...eddingResponseObjectNullable.g.verified.cs | 57 ++++++ ...teFileRequestPurposeNullable.g.verified.cs | 57 ++++++ ...rparametersBatchSizeNullable.g.verified.cs | 57 ++++++ ...arningRateMultiplierNullable.g.verified.cs | 57 ++++++ ...perparametersNEpochsNullable.g.verified.cs | 57 ++++++ ...uestIntegrationsTypeNullable.g.verified.cs | 57 ++++++ ...uningJobRequestModelNullable.g.verified.cs | 57 ++++++ ...mageEditRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...ImageEditRequestSizeNullable.g.verified.cs | 57 ++++++ ...ateImageRequestModelNullable.g.verified.cs | 57 ++++++ ...eImageRequestQualityNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...eateImageRequestSizeNullable.g.verified.cs | 57 ++++++ ...ateImageRequestStyleNullable.g.verified.cs | 57 ++++++ ...ariationRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...VariationRequestSizeNullable.g.verified.cs | 57 ++++++ ...teMessageRequestRoleNullable.g.verified.cs | 57 ++++++ ...derationRequestModelNullable.g.verified.cs | 57 ++++++ ...reateRunRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...RunRequestToolChoiceNullable.g.verified.cs | 57 ++++++ ...teSpeechRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...teSpeechRequestVoiceNullable.g.verified.cs | 57 ++++++ ...adAndRunRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...RunRequestToolChoiceNullable.g.verified.cs | 57 ++++++ ...criptionRequestModelNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...nslationRequestModelNullable.g.verified.cs | 57 ++++++ ...istantResponseObjectNullable.g.verified.cs | 57 ++++++ ...teFileResponseObjectNullable.g.verified.cs | 57 ++++++ ...essageResponseObjectNullable.g.verified.cs | 57 ++++++ ...ThreadResponseObjectNullable.g.verified.cs | 57 ++++++ ...reFileResponseObjectNullable.g.verified.cs | 57 ++++++ ...rStoreResponseObjectNullable.g.verified.cs | 57 ++++++ ...erters.DoneEventDataNullable.g.verified.cs | 57 ++++++ ...rters.DoneEventEventNullable.g.verified.cs | 57 ++++++ ...ters.EmbeddingObjectNullable.g.verified.cs | 57 ++++++ ...ters.ErrorEventEventNullable.g.verified.cs | 57 ++++++ ...uningIntegrationTypeNullable.g.verified.cs | 57 ++++++ ...gJobCheckpointObjectNullable.g.verified.cs | 57 ++++++ ...eTuningJobEventLevelNullable.g.verified.cs | 57 ++++++ ...TuningJobEventObjectNullable.g.verified.cs | 57 ++++++ ...perparametersNEpochsNullable.g.verified.cs | 57 ++++++ ....FineTuningJobObjectNullable.g.verified.cs | 57 ++++++ ....FineTuningJobStatusNullable.g.verified.cs | 57 ++++++ ....ListAssistantsOrderNullable.g.verified.cs | 57 ++++++ ...atchesResponseObjectNullable.g.verified.cs | 57 ++++++ ...ctorStoreBatchFilterNullable.g.verified.cs | 57 ++++++ ...ectorStoreBatchOrderNullable.g.verified.cs | 57 ++++++ ...tFilesResponseObjectNullable.g.verified.cs | 57 ++++++ ...pointsResponseObjectNullable.g.verified.cs | 57 ++++++ ...EventsResponseObjectNullable.g.verified.cs | 57 ++++++ ...rs.ListMessagesOrderNullable.g.verified.cs | 57 ++++++ ...ModelsResponseObjectNullable.g.verified.cs | 57 ++++++ ...ngJobsResponseObjectNullable.g.verified.cs | 57 ++++++ ...rs.ListRunStepsOrderNullable.g.verified.cs | 57 ++++++ ...erters.ListRunsOrderNullable.g.verified.cs | 57 ++++++ ...ctorStoreFilesFilterNullable.g.verified.cs | 57 ++++++ ...ectorStoreFilesOrderNullable.g.verified.cs | 57 ++++++ ...istVectorStoresOrderNullable.g.verified.cs | 57 ++++++ ...bjectImageFileDetailNullable.g.verified.cs | 57 ++++++ ...tImageFileObjectTypeNullable.g.verified.cs | 57 ++++++ ...ObjectImageUrlDetailNullable.g.verified.cs | 57 ++++++ ...ntImageUrlObjectTypeNullable.g.verified.cs | 57 ++++++ ...leCitationObjectTypeNullable.g.verified.cs | 57 ++++++ ...nsFilePathObjectTypeNullable.g.verified.cs | 57 ++++++ ...ontentTextObjectTypeNullable.g.verified.cs | 57 ++++++ ...bjectImageFileDetailNullable.g.verified.cs | 57 ++++++ ...tImageFileObjectTypeNullable.g.verified.cs | 57 ++++++ ...ObjectImageUrlDetailNullable.g.verified.cs | 57 ++++++ ...ntImageUrlObjectTypeNullable.g.verified.cs | 57 ++++++ ...leCitationObjectTypeNullable.g.verified.cs | 57 ++++++ ...nsFilePathObjectTypeNullable.g.verified.cs | 57 ++++++ ...ontentTextObjectTypeNullable.g.verified.cs | 57 ++++++ ...DeltaObjectDeltaRoleNullable.g.verified.cs | 57 ++++++ ...ageDeltaObjectObjectNullable.g.verified.cs | 57 ++++++ ...ompleteDetailsReasonNullable.g.verified.cs | 57 ++++++ ....MessageObjectObjectNullable.g.verified.cs | 57 ++++++ ...rs.MessageObjectRoleNullable.g.verified.cs | 57 ++++++ ....MessageObjectStatusNullable.g.verified.cs | 57 ++++++ ...ontentTextObjectTypeNullable.g.verified.cs | 57 ++++++ ...nverters.ModelObjectNullable.g.verified.cs | 57 ++++++ ...equestResponseFormatNullable.g.verified.cs | 57 ++++++ ...ers.OpenAIFileObjectNullable.g.verified.cs | 57 ++++++ ...rs.OpenAIFilePurposeNullable.g.verified.cs | 57 ++++++ ...ers.OpenAIFileStatusNullable.g.verified.cs | 57 ++++++ ...ompleteDetailsReasonNullable.g.verified.cs | 57 ++++++ ...nObjectLastErrorCodeNullable.g.verified.cs | 57 ++++++ ...ters.RunObjectObjectNullable.g.verified.cs | 57 ++++++ ...ctRequiredActionTypeNullable.g.verified.cs | 57 ++++++ ...ObjectResponseFormatNullable.g.verified.cs | 57 ++++++ ...ters.RunObjectStatusNullable.g.verified.cs | 57 ++++++ ....RunObjectToolChoiceNullable.g.verified.cs | 57 ++++++ ...tepDeltaObjectObjectNullable.g.verified.cs | 57 ++++++ ...geCreationObjectTypeNullable.g.verified.cs | 57 ++++++ ...lCallsCodeObjectTypeNullable.g.verified.cs | 57 ++++++ ...utputImageObjectTypeNullable.g.verified.cs | 57 ++++++ ...OutputLogsObjectTypeNullable.g.verified.cs | 57 ++++++ ...FileSearchObjectTypeNullable.g.verified.cs | 57 ++++++ ...lsFunctionObjectTypeNullable.g.verified.cs | 57 ++++++ ...sToolCallsObjectTypeNullable.g.verified.cs | 57 ++++++ ...geCreationObjectTypeNullable.g.verified.cs | 57 ++++++ ...lCallsCodeObjectTypeNullable.g.verified.cs | 57 ++++++ ...utputImageObjectTypeNullable.g.verified.cs | 57 ++++++ ...OutputLogsObjectTypeNullable.g.verified.cs | 57 ++++++ ...FileSearchObjectTypeNullable.g.verified.cs | 57 ++++++ ...lsFunctionObjectTypeNullable.g.verified.cs | 57 ++++++ ...sToolCallsObjectTypeNullable.g.verified.cs | 57 ++++++ ...pObjectLastErrorCodeNullable.g.verified.cs | 57 ++++++ ....RunStepObjectObjectNullable.g.verified.cs | 57 ++++++ ....RunStepObjectStatusNullable.g.verified.cs | 57 ++++++ ...rs.RunStepObjectTypeNullable.g.verified.cs | 57 ++++++ ...unToolCallObjectTypeNullable.g.verified.cs | 57 ++++++ ...s.ThreadObjectObjectNullable.g.verified.cs | 57 ++++++ ...TruncationObjectTypeNullable.g.verified.cs | 57 ++++++ ...xpirationAfterAnchorNullable.g.verified.cs | 57 ++++++ ...ileBatchObjectObjectNullable.g.verified.cs | 57 ++++++ ...ileBatchObjectStatusNullable.g.verified.cs | 57 ++++++ ...eObjectLastErrorCodeNullable.g.verified.cs | 57 ++++++ ...toreFileObjectObjectNullable.g.verified.cs | 57 ++++++ ...toreFileObjectStatusNullable.g.verified.cs | 57 ++++++ ...torStoreObjectObjectNullable.g.verified.cs | 57 ++++++ ...torStoreObjectStatusNullable.g.verified.cs | 57 ++++++ .../SystemTextJson/_#G.Api.g.verified.cs | 9 + ...ReleaseCreatedByTypeNullable.g.verified.cs | 57 ++++++ ...elsRequestVisibilityNullable.g.verified.cs | 57 ++++++ ...tAccountResponseTypeNullable.g.verified.cs | 57 ++++++ ...ReleaseCreatedByTypeNullable.g.verified.cs | 57 ++++++ ...ReleaseCreatedByTypeNullable.g.verified.cs | 57 ++++++ ...tWebhookEventsFilterNullable.g.verified.cs | 57 ++++++ ...tWebhookEventsFilterNullable.g.verified.cs | 57 ++++++ ...ReleaseCreatedByTypeNullable.g.verified.cs | 57 ++++++ ...tWebhookEventsFilterNullable.g.verified.cs | 57 ++++++ .../SystemTextJson/_#G.Api.g.verified.cs | 75 ++++++++ ...ters.BlockUserReasonNullable.g.verified.cs | 57 ++++++ ...ockUserSourceContextNullable.g.verified.cs | 57 ++++++ ...sterSubscriptionTierNullable.g.verified.cs | 57 ++++++ ...hannelEmoteEmoteTypeNullable.g.verified.cs | 57 ++++++ ...s.ChannelEmoteFormatNullable.g.verified.cs | 57 ++++++ ...rs.ChannelEmoteScaleNullable.g.verified.cs | 57 ++++++ ...hannelEmoteThemeModeNullable.g.verified.cs | 57 ++++++ ...ers.CheermoteTiersIdNullable.g.verified.cs | 57 ++++++ ...erters.CheermoteTypeNullable.g.verified.cs | 57 ++++++ ...nBodyTransportMethodNullable.g.verified.cs | 57 ++++++ ...SubscriptionBodyTypeNullable.g.verified.cs | 57 ++++++ ...ters.CreatorGoalTypeNullable.g.verified.cs | 57 ++++++ ...wardRedemptionStatusNullable.g.verified.cs | 57 ++++++ ...entFulfillmentStatusNullable.g.verified.cs | 57 ++++++ ...tlementUpdatedStatusNullable.g.verified.cs | 57 ++++++ ...rters.EmoteEmoteTypeNullable.g.verified.cs | 57 ++++++ ...nverters.EmoteFormatNullable.g.verified.cs | 57 ++++++ ...onverters.EmoteScaleNullable.g.verified.cs | 57 ++++++ ...rters.EmoteThemeModeNullable.g.verified.cs | 57 ++++++ ...rs.EndPollBodyStatusNullable.g.verified.cs | 57 ++++++ ...PredictionBodyStatusNullable.g.verified.cs | 57 ++++++ ...ubSubscriptionStatusNullable.g.verified.cs | 57 ++++++ ...ptionTransportMethodNullable.g.verified.cs | 57 ++++++ ...tSubSubscriptionTypeNullable.g.verified.cs | 57 ++++++ ...nBitsProductCostTypeNullable.g.verified.cs | 57 ++++++ ...onfigurationLocationNullable.g.verified.cs | 57 ++++++ ...rationSegmentSegmentNullable.g.verified.cs | 57 ++++++ ...rters.ExtensionStateNullable.g.verified.cs | 57 ++++++ ...riptionsSupportLevelNullable.g.verified.cs | 57 ++++++ ...nProductDataCostTypeNullable.g.verified.cs | 57 ++++++ ...ansactionProductTypeNullable.g.verified.cs | 57 ++++++ ...itsLeaderboardPeriodNullable.g.verified.cs | 57 ++++++ ...sResponseGroupLayoutNullable.g.verified.cs | 57 ++++++ ...dsResponseDataStatusNullable.g.verified.cs | 57 ++++++ ...eDataTransportMethodNullable.g.verified.cs | 57 ++++++ ...RewardRedemptionSortNullable.g.verified.cs | 57 ++++++ ...wardRedemptionStatusNullable.g.verified.cs | 57 ++++++ ...ntsFulfillmentStatusNullable.g.verified.cs | 57 ++++++ ...bSubscriptionsStatusNullable.g.verified.cs | 57 ++++++ ...subSubscriptionsTypeNullable.g.verified.cs | 57 ++++++ ...tensionAnalyticsTypeNullable.g.verified.cs | 57 ++++++ ...rationSegmentSegmentNullable.g.verified.cs | 57 ++++++ ...GetGameAnalyticsTypeNullable.g.verified.cs | 57 ++++++ ...rters.GetStreamsTypeNullable.g.verified.cs | 57 ++++++ ...esponseDataEmoteTypeNullable.g.verified.cs | 57 ++++++ ...ters.GetVideosPeriodNullable.g.verified.cs | 57 ++++++ ...erters.GetVideosSortNullable.g.verified.cs | 57 ++++++ ...erters.GetVideosTypeNullable.g.verified.cs | 57 ++++++ ...rs.GlobalEmoteFormatNullable.g.verified.cs | 57 ++++++ ...ers.GlobalEmoteScaleNullable.g.verified.cs | 57 ++++++ ...GlobalEmoteThemeModeNullable.g.verified.cs | 57 ++++++ ...LastContributionTypeNullable.g.verified.cs | 57 ++++++ ...TopContributionsTypeNullable.g.verified.cs | 57 ++++++ ...odMessagesBodyActionNullable.g.verified.cs | 57 ++++++ ...assificationLabelsIdNullable.g.verified.cs | 57 ++++++ ...onverters.PollStatusNullable.g.verified.cs | 57 ++++++ ...edictionOutcomeColorNullable.g.verified.cs | 57 ++++++ ...ers.PredictionStatusNullable.g.verified.cs | 57 ++++++ ...nnouncementBodyColorNullable.g.verified.cs | 57 ++++++ ...SubMessageBodyTargetNullable.g.verified.cs | 57 ++++++ ...onSegmentBodySegmentNullable.g.verified.cs | 57 ++++++ ...onverters.StreamTypeNullable.g.verified.cs | 57 ++++++ ...tingsBodyGroupLayoutNullable.g.verified.cs | 57 ++++++ ...hardsTransportMethodNullable.g.verified.cs | 57 ++++++ ...dsResponseDataStatusNullable.g.verified.cs | 57 ++++++ ...eDataTransportMethodNullable.g.verified.cs | 57 ++++++ ...odyFulfillmentStatusNullable.g.verified.cs | 57 ++++++ ...sProductBodyCostTypeNullable.g.verified.cs | 57 ++++++ ...tionStatusBodyStatusNullable.g.verified.cs | 57 ++++++ ...teUserChatColorColorNullable.g.verified.cs | 57 ++++++ ....UserBroadcasterTypeNullable.g.verified.cs | 57 ++++++ ...rs.UserExtensionTypeNullable.g.verified.cs | 57 ++++++ ...UserSubscriptionTierNullable.g.verified.cs | 57 ++++++ ...nConverters.UserTypeNullable.g.verified.cs | 57 ++++++ ...Converters.VideoTypeNullable.g.verified.cs | 57 ++++++ .../JsonTests.Enum.AnyOf.cs | 35 ++-- .../JsonTests.Enum.New.cs | 3 +- .../LangSmith/Methods/_.verified.txt | 4 +- .../Snapshots/Ollama/Methods/_.verified.txt | 8 +- .../Snapshots/OpenAi/Methods/_.verified.txt | 172 +++++++++++++++++- .../Replicate/Methods/_.verified.txt | 11 +- 301 files changed, 16835 insertions(+), 22 deletions(-) create mode 100644 src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetUserEmotesResponseDataEmoteTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosPeriodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosSortNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteFormatNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteScaleNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteThemeModeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataLastContributionTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ManageHeldAutoModMessagesBodyActionNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PollStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionOutcomeColorNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendChatAnnouncementBodyColorNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendExtensionPubSubMessageBodyTargetNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.StreamTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateRedemptionStatusBodyStatusNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateUserChatColorColorNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserBroadcasterTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserExtensionTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserSubscriptionTierNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserTypeNullable.g.verified.cs create mode 100644 src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.VideoTypeNullable.g.verified.cs diff --git a/src/libs/OpenApiGenerator.Core/Generation/Data.cs b/src/libs/OpenApiGenerator.Core/Generation/Data.cs index 4a28169d01..03c6de5b5d 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Data.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Data.cs @@ -264,7 +264,10 @@ .. includedTags.Select(x => PropertyData.Default with { Converters = models .Where(x => x.Style == ModelStyle.Enumeration && x.JsonSerializerType != JsonSerializerType.NewtonsoftJson) - .Select(x => $"global::OpenApiGenerator.JsonConverters.{x.ClassName}JsonConverter") + .SelectMany(x => new [] { + $"global::OpenApiGenerator.JsonConverters.{x.ClassName}JsonConverter", + $"global::OpenApiGenerator.JsonConverters.{x.ClassName}NullableJsonConverter" + }) .ToImmutableArray(), }; } @@ -323,6 +326,21 @@ public static FileWithName GetSourceCodeForEnumJsonConverter( Name: $"JsonConverters.{data.ClassName}.g.cs", Text: Sources.GenerateEnumJsonConverter(data, cancellationToken: cancellationToken)); } + + public static FileWithName GetSourceCodeForEnumNullableJsonConverter( + ModelData data, + CancellationToken cancellationToken = default) + { + if (data.Style != ModelStyle.Enumeration || + data.JsonSerializerType == JsonSerializerType.NewtonsoftJson) + { + return FileWithName.Empty; + } + + return new FileWithName( + Name: $"JsonConverters.{data.ClassName}Nullable.g.cs", + Text: Sources.GenerateEnumNullableJsonConverter(data, cancellationToken: cancellationToken)); + } public static FileWithName GetSourceCodeForAnyOfJsonConverterFactory( AnyOfData anyOf, diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs index 663d3493b6..5899010503 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.Enum.cs @@ -63,6 +63,74 @@ public override void Write( }} }} }} +"; + } + + public static string GenerateEnumNullableJsonConverter( + ModelData model, + CancellationToken cancellationToken = default) + { + if (model.JsonSerializerType == JsonSerializerType.NewtonsoftJson) + { + return string.Empty; + } + + return $@"#nullable enable + +namespace OpenApiGenerator.JsonConverters +{{ + /// + public sealed class {model.ClassName}NullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<{model.GlobalClassName}?> + {{ + /// + public override {model.GlobalClassName}? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + {{ + switch (reader.TokenType) + {{ + case global::System.Text.Json.JsonTokenType.String: + {{ + var stringValue = reader.GetString(); + if (stringValue != null) + {{ + return {model.GlobalClassName}Extensions.ToEnum(stringValue); + }} + + break; + }} + case global::System.Text.Json.JsonTokenType.Number: + {{ + var numValue = reader.GetInt32(); + return ({model.GlobalClassName})numValue; + }} + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + }} + + return default; + }} + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + {model.GlobalClassName}? value, + global::System.Text.Json.JsonSerializerOptions options) + {{ + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + {{ + writer.WriteNullValue(); + }} + else + {{ + writer.WriteStringValue({model.GlobalClassName}Extensions.ToValueString(value.Value)); + }} + }} + }} +}} "; } } \ No newline at end of file diff --git a/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs b/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs new file mode 100644 index 0000000000..f85d1d40a4 --- /dev/null +++ b/src/libs/OpenApiGenerator.Helpers/JsonEnumConverter/TestEnumNullableJsonStringEnumConverter.cs @@ -0,0 +1,49 @@ +namespace OpenApiGenerator.JsonConverters; + +public sealed class TestEnumNullableJsonStringEnumConverter : global::System.Text.Json.Serialization.JsonConverter +{ + public override TestEnum? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return TestEnumExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + return (TestEnum)reader.GetInt32(); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + TestEnum? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(value.Value.ToValueString()); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenApiGenerator/SdkGenerator.cs b/src/libs/OpenApiGenerator/SdkGenerator.cs index 6c65360051..33d6639c80 100644 --- a/src/libs/OpenApiGenerator/SdkGenerator.cs +++ b/src/libs/OpenApiGenerator/SdkGenerator.cs @@ -45,6 +45,10 @@ public void Initialize(IncrementalGeneratorInitializationContext context) .SelectMany(static (x, _) => x.Models) .SelectAndReportExceptions(GetEnumJsonConverterSourceCode, context, Id) .AddSource(context); + data + .SelectMany(static (x, _) => x.Models) + .SelectAndReportExceptions(GetEnumNullableJsonConverterSourceCode, context, Id) + .AddSource(context); data .SelectMany(static (x, _) => x.AnyOfs) @@ -122,6 +126,17 @@ private static FileWithName GetEnumJsonConverterSourceCode( Text: fileWithName.Text); } + private static FileWithName GetEnumNullableJsonConverterSourceCode( + ModelData model, + CancellationToken cancellationToken = default) + { + var fileWithName = Data.GetSourceCodeForEnumNullableJsonConverter(model, cancellationToken); + + return new FileWithName( + Name: fileWithName.Name, + Text: fileWithName.Text); + } + private static FileWithName GetAnyOfJsonConverterFactorySourceCode( AnyOfData anyOf, CancellationToken cancellationToken = default) diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs index 0ce44ab827..7b76406932 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#G.Api.g.verified.cs @@ -42,25 +42,45 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitTitleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitTitleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitMessageJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositorySquashMergeCommitMessageNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitTitleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitTitleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitMessageJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RepositoryMergeCommitMessageNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ImportStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ImportStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PagesHttpsCertificateStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PagesHttpsCertificateStateNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PageStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PageProtectedDomainStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageProtectedDomainStateNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PageBuildTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PageBuildTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsListForOrgExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsListForOrgExcludeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsStartForOrgRequestExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartForOrgRequestExcludeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsGetStatusForOrgExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsGetStatusForOrgExcludeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsStartImportRequestVcsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartImportRequestVcsNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsUpdateImportRequestVcsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsUpdateImportRequestVcsNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs new file mode 100644 index 0000000000..be6ddfd9e7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.ImportStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ImportStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ImportStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ImportStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ImportStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ImportStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ImportStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ImportStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs new file mode 100644 index 0000000000..e04ee5c964 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsGetStatusForOrgExcludeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsGetStatusForOrgExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsGetStatusForOrgExclude? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsGetStatusForOrgExcludeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsGetStatusForOrgExclude)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsGetStatusForOrgExclude? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsGetStatusForOrgExcludeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs new file mode 100644 index 0000000000..18f0a5ffbb --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsListForOrgExcludeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsListForOrgExcludeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsListForOrgExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsListForOrgExclude? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsListForOrgExcludeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsListForOrgExclude)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsListForOrgExclude? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsListForOrgExcludeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs new file mode 100644 index 0000000000..d7932cc407 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsSetLfsPreferenceRequestUseLfsNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsSetLfsPreferenceRequestUseLfsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsSetLfsPreferenceRequestUseLfs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsSetLfsPreferenceRequestUseLfsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsSetLfsPreferenceRequestUseLfs)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsSetLfsPreferenceRequestUseLfs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsSetLfsPreferenceRequestUseLfsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs new file mode 100644 index 0000000000..26b2f31781 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsStartForAuthenticatedUserRequestExcludeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsStartForAuthenticatedUserRequestExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsStartForAuthenticatedUserRequestExclude? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsStartForAuthenticatedUserRequestExcludeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsStartForAuthenticatedUserRequestExclude)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsStartForAuthenticatedUserRequestExclude? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsStartForAuthenticatedUserRequestExcludeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs new file mode 100644 index 0000000000..f21eaf05b9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsStartForOrgRequestExcludeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsStartForOrgRequestExcludeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsStartForOrgRequestExclude? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsStartForOrgRequestExcludeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsStartForOrgRequestExclude)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsStartForOrgRequestExclude? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsStartForOrgRequestExcludeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs new file mode 100644 index 0000000000..64a2370529 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsStartImportRequestVcsNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsStartImportRequestVcsNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsStartImportRequestVcsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsStartImportRequestVcs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsStartImportRequestVcsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsStartImportRequestVcs)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsStartImportRequestVcs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsStartImportRequestVcsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs new file mode 100644 index 0000000000..5d7241235b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MigrationsUpdateImportRequestVcsNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MigrationsUpdateImportRequestVcsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MigrationsUpdateImportRequestVcs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MigrationsUpdateImportRequestVcsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MigrationsUpdateImportRequestVcs)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MigrationsUpdateImportRequestVcs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MigrationsUpdateImportRequestVcsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs new file mode 100644 index 0000000000..df8cf2136a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageBuildTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PageBuildTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PageBuildTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PageBuildType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PageBuildTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PageBuildType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PageBuildType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PageBuildTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs new file mode 100644 index 0000000000..57a653b83b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageProtectedDomainStateNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PageProtectedDomainStateNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PageProtectedDomainStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PageProtectedDomainState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PageProtectedDomainStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PageProtectedDomainState)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PageProtectedDomainState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PageProtectedDomainStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs new file mode 100644 index 0000000000..36de463d38 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PageStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PageStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PageStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PageStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PageStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PageStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PageStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PageStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs new file mode 100644 index 0000000000..d9712acf8c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.PagesHttpsCertificateStateNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PagesHttpsCertificateStateNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PagesHttpsCertificateStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PagesHttpsCertificateState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PagesHttpsCertificateStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PagesHttpsCertificateState)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PagesHttpsCertificateState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PagesHttpsCertificateStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs new file mode 100644 index 0000000000..e8cb314b3d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitMessageNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RepositoryMergeCommitMessageNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RepositoryMergeCommitMessageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RepositoryMergeCommitMessage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RepositoryMergeCommitMessageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RepositoryMergeCommitMessage)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RepositoryMergeCommitMessage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RepositoryMergeCommitMessageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs new file mode 100644 index 0000000000..77f568e9f7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositoryMergeCommitTitleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RepositoryMergeCommitTitleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RepositoryMergeCommitTitleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RepositoryMergeCommitTitle? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RepositoryMergeCommitTitleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RepositoryMergeCommitTitle)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RepositoryMergeCommitTitle? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RepositoryMergeCommitTitleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs new file mode 100644 index 0000000000..4c201595fe --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitMessageNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RepositorySquashMergeCommitMessageNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RepositorySquashMergeCommitMessageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RepositorySquashMergeCommitMessage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RepositorySquashMergeCommitMessageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RepositorySquashMergeCommitMessage)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RepositorySquashMergeCommitMessage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RepositorySquashMergeCommitMessageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs new file mode 100644 index 0000000000..6f3957c292 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.RepositorySquashMergeCommitTitleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RepositorySquashMergeCommitTitleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RepositorySquashMergeCommitTitleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RepositorySquashMergeCommitTitle? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RepositorySquashMergeCommitTitleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RepositorySquashMergeCommitTitle)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RepositorySquashMergeCommitTitle? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RepositorySquashMergeCommitTitleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs new file mode 100644 index 0000000000..c909cf90fa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SecurityAndAnalysisAdvancedSecurityStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SecurityAndAnalysisAdvancedSecurityStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SecurityAndAnalysisAdvancedSecurityStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SecurityAndAnalysisAdvancedSecurityStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SecurityAndAnalysisAdvancedSecurityStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SecurityAndAnalysisAdvancedSecurityStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SecurityAndAnalysisAdvancedSecurityStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs new file mode 100644 index 0000000000..4ad5faa165 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SecurityAndAnalysisDependabotSecurityUpdatesStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SecurityAndAnalysisDependabotSecurityUpdatesStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SecurityAndAnalysisDependabotSecurityUpdatesStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs new file mode 100644 index 0000000000..e240be1aef --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SecurityAndAnalysisSecretScanningPushProtectionStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SecurityAndAnalysisSecretScanningPushProtectionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SecurityAndAnalysisSecretScanningPushProtectionStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SecurityAndAnalysisSecretScanningPushProtectionStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SecurityAndAnalysisSecretScanningPushProtectionStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs new file mode 100644 index 0000000000..864fd76993 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Filtering/SystemTextJson/_#JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SecurityAndAnalysisSecretScanningStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SecurityAndAnalysisSecretScanningStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SecurityAndAnalysisSecretScanningStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SecurityAndAnalysisSecretScanningStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SecurityAndAnalysisSecretScanningStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SecurityAndAnalysisSecretScanningStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SecurityAndAnalysisSecretScanningStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs index 84822078dc..add477815b 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#G.Api.g.verified.cs @@ -72,7 +72,9 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.AsnResponseTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AsnResponseTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CompanyTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CompanyTypeNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs new file mode 100644 index 0000000000..d69c619bf2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.AsnResponseTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AsnResponseTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AsnResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AsnResponseType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AsnResponseTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AsnResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AsnResponseType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AsnResponseTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs new file mode 100644 index 0000000000..737b6214a1 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/IpInfo/SystemTextJson/_#JsonConverters.CompanyTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CompanyTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CompanyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CompanyType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CompanyTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CompanyType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CompanyType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CompanyTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs index 8c06801234..1f9893f40e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#G.Api.g.verified.cs @@ -37,7 +37,9 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs new file mode 100644 index 0000000000..ea5b716189 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunCreateSchemaExtendedRunTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunCreateSchemaExtendedRunTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunCreateSchemaExtendedRunType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunCreateSchemaExtendedRunTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunCreateSchemaExtendedRunType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunCreateSchemaExtendedRunType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunCreateSchemaExtendedRunTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs new file mode 100644 index 0000000000..386041298c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/LangSmith/SystemTextJson/_#JsonConverters.RunCreateSchemaRunTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunCreateSchemaRunTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunCreateSchemaRunTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunCreateSchemaRunType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunCreateSchemaRunTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunCreateSchemaRunType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunCreateSchemaRunType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunCreateSchemaRunTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs index e07319c241..d97e74149c 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#G.Api.g.verified.cs @@ -57,11 +57,17 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PullModelResponseStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PullModelResponseStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PushModelResponseStatusNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs new file mode 100644 index 0000000000..80c6dd56f6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.CreateModelResponseStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateModelResponseStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateModelResponseStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateModelResponseStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateModelResponseStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateModelResponseStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateModelResponseStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs new file mode 100644 index 0000000000..6ca8b6f2f8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateChatCompletionRequestFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GenerateChatCompletionRequestFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GenerateChatCompletionRequestFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GenerateChatCompletionRequestFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GenerateChatCompletionRequestFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GenerateChatCompletionRequestFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GenerateChatCompletionRequestFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GenerateChatCompletionRequestFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs new file mode 100644 index 0000000000..8d66b2527f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.GenerateCompletionRequestFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GenerateCompletionRequestFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GenerateCompletionRequestFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GenerateCompletionRequestFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GenerateCompletionRequestFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GenerateCompletionRequestFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GenerateCompletionRequestFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GenerateCompletionRequestFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..fcbc62b113 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.MessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs new file mode 100644 index 0000000000..3f26ad91d2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PullModelResponseStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PullModelResponseStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PullModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PullModelResponseStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PullModelResponseStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PullModelResponseStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PullModelResponseStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PullModelResponseStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs new file mode 100644 index 0000000000..f02750605f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Ollama/SystemTextJson/_#JsonConverters.PushModelResponseStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PushModelResponseStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PushModelResponseStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PushModelResponseStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PushModelResponseStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PushModelResponseStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PushModelResponseStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PushModelResponseStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs index be7d0e5cb0..260fc61fb6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.OpenAiClient.g.verified.cs @@ -97,175 +97,345 @@ public OpenAiClient( Converters = { new global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ModelObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModelObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.OpenAIFileObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFileObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.OpenAIFileStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.OpenAIFileStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EmbeddingObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmbeddingObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.TruncationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.TruncationObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateRunRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ThreadObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ThreadObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageObjectRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageObjectRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ErrorEventEventJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ErrorEventEventNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DoneEventEventJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DoneEventEventNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DoneEventDataJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DoneEventDataNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BatchObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BatchStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListAssistantsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListAssistantsOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListMessagesOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListMessagesOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListRunsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListRunsOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListRunStepsOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListRunStepsOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..6cfb04fb88 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..6cd4987a78 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantObjectResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantObjectResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantObjectResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantObjectResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantObjectResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantObjectResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantObjectResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantObjectResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs new file mode 100644 index 0000000000..e734d3b709 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsCodeTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantToolsCodeTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantToolsCodeTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantToolsCodeType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantToolsCodeTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantToolsCodeType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantToolsCodeType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantToolsCodeTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs new file mode 100644 index 0000000000..539de41947 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFileSearchTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantToolsFileSearchTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantToolsFileSearchTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantToolsFileSearchType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantToolsFileSearchTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantToolsFileSearchType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantToolsFileSearchType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantToolsFileSearchTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs new file mode 100644 index 0000000000..c528b1570e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantToolsFunctionTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantToolsFunctionTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantToolsFunctionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantToolsFunctionType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantToolsFunctionTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantToolsFunctionType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantToolsFunctionType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantToolsFunctionTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs new file mode 100644 index 0000000000..f0893acb90 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsApiResponseFormatTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantsApiResponseFormatTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantsApiResponseFormatTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantsApiResponseFormatType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantsApiResponseFormatTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantsApiResponseFormatType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantsApiResponseFormatType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantsApiResponseFormatTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs new file mode 100644 index 0000000000..d6420732e4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.AssistantsNamedToolChoiceTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class AssistantsNamedToolChoiceTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.AssistantsNamedToolChoiceType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.AssistantsNamedToolChoiceTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.AssistantsNamedToolChoiceType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.AssistantsNamedToolChoiceType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.AssistantsNamedToolChoiceTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs new file mode 100644 index 0000000000..4ad7ee3b6a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BatchObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BatchObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BatchObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BatchObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BatchObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BatchObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BatchObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs new file mode 100644 index 0000000000..58cc17e59a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchRequestInputMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BatchRequestInputMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BatchRequestInputMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BatchRequestInputMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BatchRequestInputMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BatchRequestInputMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BatchRequestInputMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BatchRequestInputMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs new file mode 100644 index 0000000000..a03b3782f8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.BatchStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BatchStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BatchStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BatchStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BatchStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BatchStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BatchStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BatchStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs new file mode 100644 index 0000000000..25f20e9cf5 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionMessageToolCallChunkTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionMessageToolCallChunkTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionMessageToolCallChunkType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionMessageToolCallChunkTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionMessageToolCallChunkType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionMessageToolCallChunkType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionMessageToolCallChunkTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs new file mode 100644 index 0000000000..45ce8dc060 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionMessageToolCallTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionMessageToolCallTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionMessageToolCallType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionMessageToolCallTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionMessageToolCallType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionMessageToolCallType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionMessageToolCallTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs new file mode 100644 index 0000000000..bc4da94024 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionNamedToolChoiceTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionNamedToolChoiceTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionNamedToolChoiceType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionNamedToolChoiceTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionNamedToolChoiceType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionNamedToolChoiceType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionNamedToolChoiceTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..df2dd3f9ce --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestAssistantMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestAssistantMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestAssistantMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestAssistantMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestAssistantMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestAssistantMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestAssistantMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..4aa361e9ee --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestFunctionMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestFunctionMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestFunctionMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestFunctionMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestFunctionMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestFunctionMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestFunctionMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs new file mode 100644 index 0000000000..9f1de5143d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestMessageContentPartImageImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetailExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetail? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartImageImageUrlDetailExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs new file mode 100644 index 0000000000..0497ed924b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestMessageContentPartImageTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestMessageContentPartImageType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestMessageContentPartImageTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestMessageContentPartImageType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestMessageContentPartImageType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartImageTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs new file mode 100644 index 0000000000..8672cad063 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestMessageContentPartTextTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestMessageContentPartTextType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestMessageContentPartTextTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestMessageContentPartTextType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestMessageContentPartTextType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestMessageContentPartTextTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..3d5c1abdd7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestSystemMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestSystemMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestSystemMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestSystemMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestSystemMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestSystemMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestSystemMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..fef7bea3d8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestToolMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestToolMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestToolMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestToolMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestToolMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestToolMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestToolMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..14c5722377 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionRequestUserMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionRequestUserMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionRequestUserMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionRequestUserMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionRequestUserMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionRequestUserMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionRequestUserMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs new file mode 100644 index 0000000000..d784c9fefa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionResponseMessageRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionResponseMessageRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionResponseMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionResponseMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionResponseMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionResponseMessageRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionResponseMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionResponseMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs new file mode 100644 index 0000000000..8b50f3682e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionStreamResponseDeltaRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionStreamResponseDeltaRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionStreamResponseDeltaRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionStreamResponseDeltaRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionStreamResponseDeltaRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionStreamResponseDeltaRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionStreamResponseDeltaRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs new file mode 100644 index 0000000000..bdf8bb0e1e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionToolTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChatCompletionToolTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChatCompletionToolTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChatCompletionToolType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChatCompletionToolTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChatCompletionToolType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChatCompletionToolType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChatCompletionToolTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..360194892c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateAssistantRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateAssistantRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateAssistantRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateAssistantRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateAssistantRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateAssistantRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateAssistantRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..a7d34b0303 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateAssistantRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateAssistantRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateAssistantRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateAssistantRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateAssistantRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateAssistantRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateAssistantRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateAssistantRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs new file mode 100644 index 0000000000..05a6debef2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestCompletionWindowNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateBatchRequestCompletionWindowNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateBatchRequestCompletionWindowNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateBatchRequestCompletionWindow? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateBatchRequestCompletionWindowExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateBatchRequestCompletionWindow)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateBatchRequestCompletionWindow? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateBatchRequestCompletionWindowExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs new file mode 100644 index 0000000000..8aaa104817 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateBatchRequestEndpointNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateBatchRequestEndpointNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateBatchRequestEndpointNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateBatchRequestEndpoint? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateBatchRequestEndpointExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateBatchRequestEndpoint)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateBatchRequestEndpoint? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateBatchRequestEndpointExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs new file mode 100644 index 0000000000..d3de6fbafa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionFunctionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionFunctionResponseChoicesFinishReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionFunctionResponseChoicesFinishReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionFunctionResponseChoicesFinishReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionFunctionResponseChoicesFinishReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionFunctionResponseChoicesFinishReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..3dc0f832d7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionFunctionResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionFunctionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionFunctionResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionFunctionResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionFunctionResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionFunctionResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionFunctionResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs new file mode 100644 index 0000000000..8cd4cb5c98 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionRequestFunctionCallNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionRequestFunctionCallNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionRequestFunctionCall? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionRequestFunctionCallExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionRequestFunctionCall)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionRequestFunctionCall? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionRequestFunctionCallExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..126e99fbc7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs new file mode 100644 index 0000000000..9a21e59014 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionRequestResponseFormatTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionRequestResponseFormatType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionRequestResponseFormatTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionRequestResponseFormatType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionRequestResponseFormatType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionRequestResponseFormatTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs new file mode 100644 index 0000000000..1098720645 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionRequestToolChoiceNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionRequestToolChoice? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionRequestToolChoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionRequestToolChoice)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionRequestToolChoice? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionRequestToolChoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs new file mode 100644 index 0000000000..cc7e306bdd --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionResponseChoicesFinishReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionResponseChoicesFinishReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionResponseChoicesFinishReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionResponseChoicesFinishReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionResponseChoicesFinishReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..33c555b4a5 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs new file mode 100644 index 0000000000..05a024ed94 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionStreamResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionStreamResponseChoicesFinishReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionStreamResponseChoicesFinishReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionStreamResponseChoicesFinishReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionStreamResponseChoicesFinishReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionStreamResponseChoicesFinishReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..4cff1f55c3 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateChatCompletionStreamResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateChatCompletionStreamResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateChatCompletionStreamResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateChatCompletionStreamResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateChatCompletionStreamResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateChatCompletionStreamResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateChatCompletionStreamResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..4193e5151f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateCompletionRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateCompletionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateCompletionRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateCompletionRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateCompletionRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateCompletionRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateCompletionRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs new file mode 100644 index 0000000000..33cccbcf11 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateCompletionResponseChoicesFinishReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateCompletionResponseChoicesFinishReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateCompletionResponseChoicesFinishReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateCompletionResponseChoicesFinishReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateCompletionResponseChoicesFinishReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateCompletionResponseChoicesFinishReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateCompletionResponseChoicesFinishReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..e7f7d7766b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateCompletionResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateCompletionResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateCompletionResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateCompletionResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateCompletionResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateCompletionResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateCompletionResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateCompletionResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs new file mode 100644 index 0000000000..a66dc09ea6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateEmbeddingRequestEncodingFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateEmbeddingRequestEncodingFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateEmbeddingRequestEncodingFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateEmbeddingRequestEncodingFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateEmbeddingRequestEncodingFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateEmbeddingRequestEncodingFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateEmbeddingRequestEncodingFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..71abe472d9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateEmbeddingRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateEmbeddingRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateEmbeddingRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateEmbeddingRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateEmbeddingRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateEmbeddingRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateEmbeddingRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..fe8607075a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateEmbeddingResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateEmbeddingResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateEmbeddingResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateEmbeddingResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateEmbeddingResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateEmbeddingResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateEmbeddingResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateEmbeddingResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs new file mode 100644 index 0000000000..ce75311157 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFileRequestPurposeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFileRequestPurposeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFileRequestPurposeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFileRequestPurpose? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFileRequestPurposeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFileRequestPurpose)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFileRequestPurpose? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFileRequestPurposeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs new file mode 100644 index 0000000000..b88d419f43 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFineTuningJobRequestHyperparametersBatchSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFineTuningJobRequestHyperparametersBatchSize? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFineTuningJobRequestHyperparametersBatchSizeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFineTuningJobRequestHyperparametersBatchSize)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFineTuningJobRequestHyperparametersBatchSize? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersBatchSizeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs new file mode 100644 index 0000000000..758f3cd49d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs new file mode 100644 index 0000000000..433b49a3c5 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFineTuningJobRequestHyperparametersNEpochsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFineTuningJobRequestHyperparametersNEpochs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFineTuningJobRequestHyperparametersNEpochsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFineTuningJobRequestHyperparametersNEpochs)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFineTuningJobRequestHyperparametersNEpochs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFineTuningJobRequestHyperparametersNEpochsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..812b8f8107 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFineTuningJobRequestIntegrationsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFineTuningJobRequestIntegrationsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFineTuningJobRequestIntegrationsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFineTuningJobRequestIntegrationsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFineTuningJobRequestIntegrationsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFineTuningJobRequestIntegrationsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..c4cfbf1d7a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateFineTuningJobRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateFineTuningJobRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateFineTuningJobRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateFineTuningJobRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateFineTuningJobRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateFineTuningJobRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateFineTuningJobRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateFineTuningJobRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..f1d180687b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageEditRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageEditRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageEditRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageEditRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageEditRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageEditRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageEditRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..750eb85fb2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageEditRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageEditRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageEditRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageEditRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageEditRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageEditRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageEditRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs new file mode 100644 index 0000000000..75b608aaf7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageEditRequestSizeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageEditRequestSizeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageEditRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageEditRequestSize? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageEditRequestSizeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageEditRequestSize)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageEditRequestSize? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageEditRequestSizeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..a075d4e668 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs new file mode 100644 index 0000000000..167ce18894 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestQualityNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageRequestQualityNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageRequestQualityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageRequestQuality? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageRequestQualityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageRequestQuality)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageRequestQuality? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageRequestQualityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..c9d1a85e65 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs new file mode 100644 index 0000000000..3379e2c1b0 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestSizeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageRequestSizeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageRequestSize? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageRequestSizeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageRequestSize)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageRequestSize? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageRequestSizeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs new file mode 100644 index 0000000000..d11f04c17a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageRequestStyleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageRequestStyleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageRequestStyleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageRequestStyle? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageRequestStyleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageRequestStyle)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageRequestStyle? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageRequestStyleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..707646facf --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageVariationRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageVariationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageVariationRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageVariationRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageVariationRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageVariationRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageVariationRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..abf7588e76 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageVariationRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageVariationRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageVariationRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageVariationRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageVariationRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageVariationRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageVariationRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs new file mode 100644 index 0000000000..b2a03fe7f9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateImageVariationRequestSizeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateImageVariationRequestSizeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateImageVariationRequestSizeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateImageVariationRequestSize? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateImageVariationRequestSizeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateImageVariationRequestSize)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateImageVariationRequestSize? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateImageVariationRequestSizeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs new file mode 100644 index 0000000000..7478154b49 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateMessageRequestRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateMessageRequestRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateMessageRequestRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateMessageRequestRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateMessageRequestRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateMessageRequestRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateMessageRequestRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateMessageRequestRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..c21bfb583e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateModerationRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateModerationRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateModerationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateModerationRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateModerationRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateModerationRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateModerationRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateModerationRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..98bebf1631 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateRunRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateRunRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateRunRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateRunRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateRunRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateRunRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateRunRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..703fb13288 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateRunRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateRunRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateRunRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateRunRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateRunRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateRunRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateRunRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs new file mode 100644 index 0000000000..b6171b5715 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateRunRequestToolChoiceNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateRunRequestToolChoiceNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateRunRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateRunRequestToolChoice? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateRunRequestToolChoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateRunRequestToolChoice)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateRunRequestToolChoice? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateRunRequestToolChoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..039cf24893 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateSpeechRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateSpeechRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateSpeechRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateSpeechRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateSpeechRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateSpeechRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateSpeechRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..0433b4d186 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateSpeechRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateSpeechRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateSpeechRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateSpeechRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateSpeechRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateSpeechRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateSpeechRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs new file mode 100644 index 0000000000..9c5172f17f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateSpeechRequestVoiceNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateSpeechRequestVoiceNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateSpeechRequestVoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateSpeechRequestVoice? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateSpeechRequestVoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateSpeechRequestVoice)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateSpeechRequestVoice? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateSpeechRequestVoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..90b9b1e0db --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateThreadAndRunRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateThreadAndRunRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateThreadAndRunRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateThreadAndRunRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateThreadAndRunRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateThreadAndRunRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateThreadAndRunRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..c8e54faf29 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateThreadAndRunRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateThreadAndRunRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateThreadAndRunRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateThreadAndRunRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateThreadAndRunRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateThreadAndRunRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateThreadAndRunRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs new file mode 100644 index 0000000000..cf9656f40d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateThreadAndRunRequestToolChoiceNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateThreadAndRunRequestToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateThreadAndRunRequestToolChoice? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateThreadAndRunRequestToolChoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateThreadAndRunRequestToolChoice)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateThreadAndRunRequestToolChoice? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateThreadAndRunRequestToolChoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..ec41643c8a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateTranscriptionRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateTranscriptionRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateTranscriptionRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateTranscriptionRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateTranscriptionRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateTranscriptionRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateTranscriptionRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..2fea5eaeff --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateTranscriptionRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateTranscriptionRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateTranscriptionRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateTranscriptionRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateTranscriptionRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateTranscriptionRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateTranscriptionRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs new file mode 100644 index 0000000000..972f9c2b93 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.CreateTranslationRequestModelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateTranslationRequestModelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateTranslationRequestModelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateTranslationRequestModel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateTranslationRequestModelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateTranslationRequestModel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateTranslationRequestModel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateTranslationRequestModelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..ef5f42aeec --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteAssistantResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteAssistantResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteAssistantResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteAssistantResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteAssistantResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteAssistantResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteAssistantResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteAssistantResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..0b524f6d89 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteFileResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteFileResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteFileResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteFileResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteFileResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteFileResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteFileResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteFileResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..914a76bfcc --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteMessageResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteMessageResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteMessageResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteMessageResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteMessageResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteMessageResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteMessageResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteMessageResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..858c1e9512 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteThreadResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteThreadResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteThreadResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteThreadResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteThreadResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteThreadResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteThreadResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteThreadResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..9021051526 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteVectorStoreFileResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteVectorStoreFileResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteVectorStoreFileResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteVectorStoreFileResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteVectorStoreFileResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteVectorStoreFileResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteVectorStoreFileResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..4490e328d2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DeleteVectorStoreResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DeleteVectorStoreResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DeleteVectorStoreResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DeleteVectorStoreResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DeleteVectorStoreResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DeleteVectorStoreResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DeleteVectorStoreResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DeleteVectorStoreResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs new file mode 100644 index 0000000000..081b410688 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventDataNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DoneEventDataNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DoneEventDataNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DoneEventData? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DoneEventDataExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DoneEventData)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DoneEventData? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DoneEventDataExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs new file mode 100644 index 0000000000..f335ff1bda --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.DoneEventEventNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DoneEventEventNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DoneEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DoneEventEvent? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DoneEventEventExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DoneEventEvent)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DoneEventEvent? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DoneEventEventExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs new file mode 100644 index 0000000000..c5f6b43f43 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.EmbeddingObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EmbeddingObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EmbeddingObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EmbeddingObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EmbeddingObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EmbeddingObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EmbeddingObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EmbeddingObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs new file mode 100644 index 0000000000..4f2bbf8817 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ErrorEventEventNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ErrorEventEventNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ErrorEventEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ErrorEventEvent? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ErrorEventEventExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ErrorEventEvent)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ErrorEventEvent? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ErrorEventEventExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs new file mode 100644 index 0000000000..924381d9ef --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningIntegrationTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningIntegrationTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningIntegrationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningIntegrationType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningIntegrationTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningIntegrationType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningIntegrationType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningIntegrationTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs new file mode 100644 index 0000000000..56b8afbbf8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobCheckpointObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobCheckpointObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobCheckpointObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobCheckpointObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobCheckpointObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobCheckpointObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobCheckpointObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobCheckpointObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs new file mode 100644 index 0000000000..6eb2d5c67e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventLevelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobEventLevelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobEventLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobEventLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobEventLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobEventLevel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobEventLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobEventLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs new file mode 100644 index 0000000000..323c45cd5f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobEventObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobEventObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobEventObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobEventObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobEventObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobEventObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobEventObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobEventObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs new file mode 100644 index 0000000000..5cf30765d7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobHyperparametersNEpochsNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobHyperparametersNEpochsNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobHyperparametersNEpochs? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobHyperparametersNEpochsExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobHyperparametersNEpochs)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobHyperparametersNEpochs? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobHyperparametersNEpochsExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs new file mode 100644 index 0000000000..74b9ff318b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs new file mode 100644 index 0000000000..747b1093ce --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.FineTuningJobStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.FineTuningJobStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class FineTuningJobStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.FineTuningJobStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.FineTuningJobStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.FineTuningJobStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.FineTuningJobStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.FineTuningJobStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs new file mode 100644 index 0000000000..792437ba07 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListAssistantsOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListAssistantsOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListAssistantsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListAssistantsOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListAssistantsOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListAssistantsOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListAssistantsOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListAssistantsOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..ec857902f7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListBatchesResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListBatchesResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListBatchesResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListBatchesResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListBatchesResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListBatchesResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListBatchesResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListBatchesResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs new file mode 100644 index 0000000000..b46d6f2478 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListFilesInVectorStoreBatchFilterNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListFilesInVectorStoreBatchFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListFilesInVectorStoreBatchFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListFilesInVectorStoreBatchFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListFilesInVectorStoreBatchFilter)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListFilesInVectorStoreBatchFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListFilesInVectorStoreBatchFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs new file mode 100644 index 0000000000..a834ee3675 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListFilesInVectorStoreBatchOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListFilesInVectorStoreBatchOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListFilesInVectorStoreBatchOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListFilesInVectorStoreBatchOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListFilesInVectorStoreBatchOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListFilesInVectorStoreBatchOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListFilesInVectorStoreBatchOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..a08f630e8a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFilesResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListFilesResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListFilesResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListFilesResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListFilesResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListFilesResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListFilesResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListFilesResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..ad16455aff --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListFineTuningJobCheckpointsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListFineTuningJobCheckpointsResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListFineTuningJobCheckpointsResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListFineTuningJobCheckpointsResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListFineTuningJobCheckpointsResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListFineTuningJobCheckpointsResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..23edb9b401 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListFineTuningJobEventsResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListFineTuningJobEventsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListFineTuningJobEventsResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListFineTuningJobEventsResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListFineTuningJobEventsResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListFineTuningJobEventsResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListFineTuningJobEventsResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs new file mode 100644 index 0000000000..cf47dc8511 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListMessagesOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListMessagesOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListMessagesOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListMessagesOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListMessagesOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListMessagesOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListMessagesOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListMessagesOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..a52253cf3e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListModelsResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListModelsResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListModelsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListModelsResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListModelsResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListModelsResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListModelsResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListModelsResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs new file mode 100644 index 0000000000..65da633086 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListPaginatedFineTuningJobsResponseObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListPaginatedFineTuningJobsResponseObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListPaginatedFineTuningJobsResponseObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListPaginatedFineTuningJobsResponseObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListPaginatedFineTuningJobsResponseObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListPaginatedFineTuningJobsResponseObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs new file mode 100644 index 0000000000..c22ea276be --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunStepsOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListRunStepsOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListRunStepsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListRunStepsOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListRunStepsOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListRunStepsOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListRunStepsOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListRunStepsOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs new file mode 100644 index 0000000000..9ded09ce61 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListRunsOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListRunsOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListRunsOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListRunsOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListRunsOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListRunsOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListRunsOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListRunsOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs new file mode 100644 index 0000000000..57b3f397e9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesFilterNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListVectorStoreFilesFilterNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListVectorStoreFilesFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListVectorStoreFilesFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListVectorStoreFilesFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListVectorStoreFilesFilter)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListVectorStoreFilesFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListVectorStoreFilesFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs new file mode 100644 index 0000000000..d9e83a839e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoreFilesOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListVectorStoreFilesOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListVectorStoreFilesOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListVectorStoreFilesOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListVectorStoreFilesOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListVectorStoreFilesOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListVectorStoreFilesOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListVectorStoreFilesOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs new file mode 100644 index 0000000000..7303143f25 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ListVectorStoresOrderNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListVectorStoresOrderNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListVectorStoresOrderNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListVectorStoresOrder? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListVectorStoresOrderExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListVectorStoresOrder)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListVectorStoresOrder? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListVectorStoresOrderExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs new file mode 100644 index 0000000000..7a52750a7f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentImageFileObjectImageFileDetailNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentImageFileObjectImageFileDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentImageFileObjectImageFileDetail? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentImageFileObjectImageFileDetailExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentImageFileObjectImageFileDetail)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentImageFileObjectImageFileDetail? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentImageFileObjectImageFileDetailExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..3c1361a436 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageFileObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentImageFileObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentImageFileObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentImageFileObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentImageFileObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentImageFileObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentImageFileObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentImageFileObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs new file mode 100644 index 0000000000..7eba0e3a7a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentImageUrlObjectImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentImageUrlObjectImageUrlDetail? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentImageUrlObjectImageUrlDetailExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentImageUrlObjectImageUrlDetail)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentImageUrlObjectImageUrlDetail? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentImageUrlObjectImageUrlDetailExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..6397268b19 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentImageUrlObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentImageUrlObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentImageUrlObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentImageUrlObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentImageUrlObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentImageUrlObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentImageUrlObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentImageUrlObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..f491262757 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentTextAnnotationsFileCitationObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentTextAnnotationsFileCitationObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentTextAnnotationsFileCitationObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentTextAnnotationsFileCitationObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentTextAnnotationsFileCitationObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..868f6d6bb2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentTextAnnotationsFilePathObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentTextAnnotationsFilePathObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentTextAnnotationsFilePathObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentTextAnnotationsFilePathObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentTextAnnotationsFilePathObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentTextAnnotationsFilePathObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..8bededeffa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageContentTextObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageContentTextObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageContentTextObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageContentTextObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageContentTextObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageContentTextObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageContentTextObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs new file mode 100644 index 0000000000..daf6079848 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentImageFileObjectImageFileDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentImageFileObjectImageFileDetail? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentImageFileObjectImageFileDetailExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentImageFileObjectImageFileDetail)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentImageFileObjectImageFileDetail? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentImageFileObjectImageFileDetailExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..aa842dcb45 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentImageFileObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentImageFileObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentImageFileObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentImageFileObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentImageFileObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentImageFileObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentImageFileObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs new file mode 100644 index 0000000000..08da881a4a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentImageUrlObjectImageUrlDetailNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentImageUrlObjectImageUrlDetail? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentImageUrlObjectImageUrlDetailExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentImageUrlObjectImageUrlDetail)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentImageUrlObjectImageUrlDetail? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentImageUrlObjectImageUrlDetailExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..72604eecd9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentImageUrlObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentImageUrlObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentImageUrlObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentImageUrlObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentImageUrlObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentImageUrlObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentImageUrlObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a96d445fda --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentTextAnnotationsFileCitationObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentTextAnnotationsFileCitationObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentTextAnnotationsFileCitationObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..b687853831 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentTextAnnotationsFilePathObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentTextAnnotationsFilePathObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentTextAnnotationsFilePathObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentTextAnnotationsFilePathObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentTextAnnotationsFilePathObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentTextAnnotationsFilePathObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..57b63acd8a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaContentTextObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaContentTextObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaContentTextObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaContentTextObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaContentTextObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaContentTextObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs new file mode 100644 index 0000000000..1a269f4b62 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaObjectDeltaRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaObjectDeltaRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaObjectDeltaRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaObjectDeltaRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaObjectDeltaRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaObjectDeltaRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaObjectDeltaRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..b76adcb1c3 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageDeltaObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageDeltaObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageDeltaObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageDeltaObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageDeltaObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageDeltaObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageDeltaObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageDeltaObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs new file mode 100644 index 0000000000..fff45ed4d8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageObjectIncompleteDetailsReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageObjectIncompleteDetailsReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageObjectIncompleteDetailsReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageObjectIncompleteDetailsReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageObjectIncompleteDetailsReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageObjectIncompleteDetailsReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageObjectIncompleteDetailsReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..4a3a21505c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs new file mode 100644 index 0000000000..7816cb2ab0 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectRoleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageObjectRoleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageObjectRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageObjectRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageObjectRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageObjectRole)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageObjectRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageObjectRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..08c237fa73 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a9990684a7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.MessageRequestContentTextObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.MessageRequestContentTextObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class MessageRequestContentTextObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.MessageRequestContentTextObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.MessageRequestContentTextObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.MessageRequestContentTextObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.MessageRequestContentTextObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.MessageRequestContentTextObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs new file mode 100644 index 0000000000..9b16725281 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModelObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ModelObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ModelObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ModelObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ModelObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ModelObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ModelObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ModelObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..c71c8b046c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ModifyAssistantRequestResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ModifyAssistantRequestResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ModifyAssistantRequestResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ModifyAssistantRequestResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ModifyAssistantRequestResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ModifyAssistantRequestResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ModifyAssistantRequestResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs new file mode 100644 index 0000000000..eb3688c874 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.OpenAIFileObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class OpenAIFileObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.OpenAIFileObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.OpenAIFileObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.OpenAIFileObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.OpenAIFileObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.OpenAIFileObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs new file mode 100644 index 0000000000..6f2994e3b8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFilePurposeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.OpenAIFilePurposeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class OpenAIFilePurposeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.OpenAIFilePurpose? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.OpenAIFilePurposeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.OpenAIFilePurpose)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.OpenAIFilePurpose? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.OpenAIFilePurposeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs new file mode 100644 index 0000000000..8a84b0dd18 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.OpenAIFileStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.OpenAIFileStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class OpenAIFileStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.OpenAIFileStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.OpenAIFileStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.OpenAIFileStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.OpenAIFileStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.OpenAIFileStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs new file mode 100644 index 0000000000..8b1b1a49dc --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectIncompleteDetailsReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectIncompleteDetailsReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectIncompleteDetailsReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectIncompleteDetailsReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectIncompleteDetailsReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectIncompleteDetailsReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectIncompleteDetailsReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs new file mode 100644 index 0000000000..e49f913eee --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectLastErrorCodeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectLastErrorCodeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectLastErrorCode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectLastErrorCodeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectLastErrorCode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectLastErrorCode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectLastErrorCodeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..a96cfcc663 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs new file mode 100644 index 0000000000..982b360a20 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectRequiredActionTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectRequiredActionTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectRequiredActionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectRequiredActionType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectRequiredActionTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectRequiredActionType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectRequiredActionType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectRequiredActionTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs new file mode 100644 index 0000000000..cc186b315c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectResponseFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectResponseFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectResponseFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectResponseFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectResponseFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectResponseFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectResponseFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectResponseFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..e6418a10b0 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs new file mode 100644 index 0000000000..b82ed6145a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunObjectToolChoiceNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunObjectToolChoiceNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunObjectToolChoiceNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunObjectToolChoice? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunObjectToolChoiceExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunObjectToolChoice)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunObjectToolChoice? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunObjectToolChoiceExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..35597a541e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a6ea30d98f --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsMessageCreationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsMessageCreationObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsMessageCreationObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsMessageCreationObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsMessageCreationObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsMessageCreationObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..106a5c7280 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsCodeObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsCodeObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..f4306428b4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..188b94e7bb --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..f9c1de49d1 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..21606a21ce --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..2c082ce021 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDeltaStepDetailsToolCallsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDeltaStepDetailsToolCallsObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDeltaStepDetailsToolCallsObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDeltaStepDetailsToolCallsObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDeltaStepDetailsToolCallsObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDeltaStepDetailsToolCallsObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..17acba4a81 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsMessageCreationObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsMessageCreationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsMessageCreationObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsMessageCreationObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsMessageCreationObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsMessageCreationObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsMessageCreationObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..87f4b664de --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsCodeObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsCodeObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsCodeObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsCodeObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsCodeObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..faae6aa848 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsCodeOutputImageObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsCodeOutputImageObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsCodeOutputImageObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeOutputImageObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..5ac8912a72 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsCodeOutputLogsObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsCodeOutputLogsObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..72f5cc39f7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsFileSearchObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsFileSearchObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsFileSearchObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsFileSearchObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsFileSearchObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a1d64597d7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsFunctionObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsFunctionObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsFunctionObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsFunctionObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsFunctionObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..b3688b57d5 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepDetailsToolCallsObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepDetailsToolCallsObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepDetailsToolCallsObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepDetailsToolCallsObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepDetailsToolCallsObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepDetailsToolCallsObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepDetailsToolCallsObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs new file mode 100644 index 0000000000..fc89faf7ac --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectLastErrorCodeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepObjectLastErrorCodeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepObjectLastErrorCode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepObjectLastErrorCodeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepObjectLastErrorCode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepObjectLastErrorCode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepObjectLastErrorCodeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..f03dca25f6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..2f6b32369b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..3cc8e23823 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunStepObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunStepObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunStepObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunStepObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunStepObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunStepObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunStepObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunStepObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..2fb2cc1a99 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.RunToolCallObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.RunToolCallObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class RunToolCallObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.RunToolCallObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.RunToolCallObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.RunToolCallObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.RunToolCallObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.RunToolCallObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..ff74accddf --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ThreadObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ThreadObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ThreadObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ThreadObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ThreadObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ThreadObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ThreadObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ThreadObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs new file mode 100644 index 0000000000..70f54b9fb9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.TruncationObjectTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.TruncationObjectTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class TruncationObjectTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.TruncationObjectType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.TruncationObjectTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.TruncationObjectType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.TruncationObjectType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.TruncationObjectTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs new file mode 100644 index 0000000000..ff4f62f34a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreExpirationAfterAnchorNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreExpirationAfterAnchorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreExpirationAfterAnchor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreExpirationAfterAnchorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreExpirationAfterAnchor)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreExpirationAfterAnchor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreExpirationAfterAnchorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..e30b33bcf9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreFileBatchObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreFileBatchObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreFileBatchObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreFileBatchObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreFileBatchObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreFileBatchObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreFileBatchObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..a853c4e65d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreFileBatchObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreFileBatchObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreFileBatchObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreFileBatchObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreFileBatchObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreFileBatchObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreFileBatchObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs new file mode 100644 index 0000000000..27bdd1b847 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreFileObjectLastErrorCodeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreFileObjectLastErrorCodeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreFileObjectLastErrorCode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreFileObjectLastErrorCodeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreFileObjectLastErrorCode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreFileObjectLastErrorCode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreFileObjectLastErrorCodeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..39904fce62 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreFileObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreFileObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreFileObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreFileObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreFileObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreFileObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreFileObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..e293d6a251 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreFileObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreFileObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreFileObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreFileObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreFileObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreFileObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreFileObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreFileObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs new file mode 100644 index 0000000000..f87bd6d6a2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectObjectNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreObjectObjectNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreObjectObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreObjectObject? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreObjectObjectExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreObjectObject)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreObjectObject? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreObjectObjectExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs new file mode 100644 index 0000000000..1de9f251b6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.VectorStoreObjectStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VectorStoreObjectStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VectorStoreObjectStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VectorStoreObjectStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VectorStoreObjectStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VectorStoreObjectStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VectorStoreObjectStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VectorStoreObjectStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs index cd3bd7418e..4591350b70 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#G.Api.g.verified.cs @@ -37,14 +37,23 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs new file mode 100644 index 0000000000..c63e1c05f2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateDeploymentsResponseCurrentReleaseCreatedByType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs new file mode 100644 index 0000000000..e48acf4762 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.CreateModelsRequestVisibilityNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateModelsRequestVisibilityNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateModelsRequestVisibilityNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateModelsRequestVisibility? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateModelsRequestVisibilityExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateModelsRequestVisibility)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateModelsRequestVisibility? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateModelsRequestVisibilityExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs new file mode 100644 index 0000000000..077cfefc00 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetAccountResponseTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetAccountResponseTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetAccountResponseTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetAccountResponseType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetAccountResponseTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetAccountResponseType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetAccountResponseType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetAccountResponseTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs new file mode 100644 index 0000000000..3263688ffe --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetDeploymentsResponseCurrentReleaseCreatedByType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetDeploymentsResponseCurrentReleaseCreatedByType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetDeploymentsResponseCurrentReleaseCreatedByType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a9d8aac1fa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs new file mode 100644 index 0000000000..2c9486a8d6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PredictionRequestWebhookEventsFilterNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PredictionRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PredictionRequestWebhookEventsFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PredictionRequestWebhookEventsFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PredictionRequestWebhookEventsFilter)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PredictionRequestWebhookEventsFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PredictionRequestWebhookEventsFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs new file mode 100644 index 0000000000..7e6c4cd7da --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.TrainingRequestWebhookEventsFilterNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class TrainingRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.TrainingRequestWebhookEventsFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.TrainingRequestWebhookEventsFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.TrainingRequestWebhookEventsFilter)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.TrainingRequestWebhookEventsFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.TrainingRequestWebhookEventsFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs new file mode 100644 index 0000000000..86405372f7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs new file mode 100644 index 0000000000..45f130e4e4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Replicate/SystemTextJson/_#JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VersionPredictionRequestWebhookEventsFilterNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VersionPredictionRequestWebhookEventsFilterNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VersionPredictionRequestWebhookEventsFilter? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VersionPredictionRequestWebhookEventsFilterExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VersionPredictionRequestWebhookEventsFilter)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VersionPredictionRequestWebhookEventsFilter? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VersionPredictionRequestWebhookEventsFilterExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs index 8162ad2e78..bdaa734a9e 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#G.Api.g.verified.cs @@ -195,80 +195,155 @@ public Api( Converters = { new global::OpenApiGenerator.JsonConverters.CheermoteTiersIdJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CheermoteTiersIdNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CheermoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CheermoteTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductDataCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductDataCostTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionTransactionProductTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CustomRewardRedemptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CustomRewardRedemptionStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateRedemptionStatusBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateRedemptionStatusBodyStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChannelEmoteEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteEmoteTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChannelEmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChannelEmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteScaleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ChannelEmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ChannelEmoteThemeModeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GlobalEmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GlobalEmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteScaleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GlobalEmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GlobalEmoteThemeModeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EmoteEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteEmoteTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EmoteFormatJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteFormatNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EmoteScaleJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteScaleNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EmoteThemeModeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EmoteThemeModeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetUserEmotesResponseDataEmoteTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetUserEmotesResponseDataEmoteTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SendChatAnnouncementBodyColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SendChatAnnouncementBodyColorNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataTransportMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetConduitShardsResponseDataStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsBodyShardsTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateConduitShardsResponseDataStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DropsEntitlementFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DropsEntitlementFulfillmentStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.DropsEntitlementUpdatedStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.DropsEntitlementUpdatedStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationSegmentSegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationSegmentSegmentNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SetExtensionConfigurationSegmentBodySegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.SendExtensionPubSubMessageBodyTargetJsonConverter(), + new global::OpenApiGenerator.JsonConverters.SendExtensionPubSubMessageBodyTargetNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationLocationJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionConfigurationLocationNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionStateJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionStateNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionSubscriptionsSupportLevelJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionSubscriptionsSupportLevelNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ExtensionBitsProductCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ExtensionBitsProductCostTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateExtensionBitsProductBodyCostTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreateEventSubSubscriptionBodyTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTransportMethodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTransportMethodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EventSubSubscriptionTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.CreatorGoalTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.CreatorGoalTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataLastContributionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataLastContributionTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataTopContributionsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.ManageHeldAutoModMessagesBodyActionJsonConverter(), + new global::OpenApiGenerator.JsonConverters.ManageHeldAutoModMessagesBodyActionNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PollStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PollStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EndPollBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EndPollBodyStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PredictionOutcomeColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PredictionOutcomeColorNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.PredictionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.PredictionStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.EndPredictionBodyStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.EndPredictionBodyStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.StreamTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.StreamTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BroadcasterSubscriptionTierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BroadcasterSubscriptionTierNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UserSubscriptionTierJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserSubscriptionTierNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UserTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UserBroadcasterTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserBroadcasterTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UserExtensionTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UserExtensionTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.VideoTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.VideoTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetExtensionAnalyticsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetExtensionAnalyticsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetGameAnalyticsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetGameAnalyticsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetBitsLeaderboardPeriodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetBitsLeaderboardPeriodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionSortJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetCustomRewardRedemptionSortNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.UpdateUserChatColorColorJsonConverter(), + new global::OpenApiGenerator.JsonConverters.UpdateUserChatColorColorNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetDropsEntitlementsFulfillmentStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetDropsEntitlementsFulfillmentStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetExtensionConfigurationSegmentSegmentJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetExtensionConfigurationSegmentSegmentNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsStatusJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsStatusNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetEventsubSubscriptionsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetStreamsTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetStreamsTypeNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BlockUserSourceContextJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BlockUserSourceContextNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.BlockUserReasonJsonConverter(), + new global::OpenApiGenerator.JsonConverters.BlockUserReasonNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetVideosPeriodJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosPeriodNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetVideosSortJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosSortNullableJsonConverter(), new global::OpenApiGenerator.JsonConverters.GetVideosTypeJsonConverter(), + new global::OpenApiGenerator.JsonConverters.GetVideosTypeNullableJsonConverter(), } }; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs new file mode 100644 index 0000000000..583c537ab2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserReasonNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BlockUserReasonNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BlockUserReasonNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BlockUserReason? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BlockUserReasonExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BlockUserReason)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BlockUserReason? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BlockUserReasonExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs new file mode 100644 index 0000000000..a367fc4e60 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BlockUserSourceContextNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BlockUserSourceContextNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BlockUserSourceContextNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BlockUserSourceContext? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BlockUserSourceContextExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BlockUserSourceContext)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BlockUserSourceContext? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BlockUserSourceContextExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs new file mode 100644 index 0000000000..7a141b11ed --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.BroadcasterSubscriptionTierNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.BroadcasterSubscriptionTierNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class BroadcasterSubscriptionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.BroadcasterSubscriptionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.BroadcasterSubscriptionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.BroadcasterSubscriptionTier)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.BroadcasterSubscriptionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.BroadcasterSubscriptionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs new file mode 100644 index 0000000000..165e5094bf --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteEmoteTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChannelEmoteEmoteTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChannelEmoteEmoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChannelEmoteEmoteType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChannelEmoteEmoteTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChannelEmoteEmoteType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChannelEmoteEmoteType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChannelEmoteEmoteTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs new file mode 100644 index 0000000000..589dd4bd59 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChannelEmoteFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChannelEmoteFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChannelEmoteFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChannelEmoteFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChannelEmoteFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChannelEmoteFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChannelEmoteFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs new file mode 100644 index 0000000000..530ca39ae4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteScaleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChannelEmoteScaleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChannelEmoteScaleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChannelEmoteScale? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChannelEmoteScaleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChannelEmoteScale)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChannelEmoteScale? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChannelEmoteScaleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs new file mode 100644 index 0000000000..69e693084b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ChannelEmoteThemeModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ChannelEmoteThemeModeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ChannelEmoteThemeModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ChannelEmoteThemeMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ChannelEmoteThemeModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ChannelEmoteThemeMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ChannelEmoteThemeMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ChannelEmoteThemeModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs new file mode 100644 index 0000000000..c0a3d161aa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTiersIdNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CheermoteTiersIdNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CheermoteTiersIdNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CheermoteTiersId? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CheermoteTiersIdExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CheermoteTiersId)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CheermoteTiersId? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CheermoteTiersIdExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs new file mode 100644 index 0000000000..3657707fa3 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CheermoteTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CheermoteTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CheermoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CheermoteType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CheermoteTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CheermoteType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CheermoteType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CheermoteTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs new file mode 100644 index 0000000000..7b76cb1625 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateEventSubSubscriptionBodyTransportMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateEventSubSubscriptionBodyTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateEventSubSubscriptionBodyTransportMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateEventSubSubscriptionBodyTransportMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateEventSubSubscriptionBodyTransportMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateEventSubSubscriptionBodyTransportMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateEventSubSubscriptionBodyTransportMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs new file mode 100644 index 0000000000..f0bbc71998 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreateEventSubSubscriptionBodyTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreateEventSubSubscriptionBodyTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreateEventSubSubscriptionBodyType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreateEventSubSubscriptionBodyTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreateEventSubSubscriptionBodyType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreateEventSubSubscriptionBodyType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreateEventSubSubscriptionBodyTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs new file mode 100644 index 0000000000..054f04ff55 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CreatorGoalTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CreatorGoalTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CreatorGoalTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CreatorGoalType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CreatorGoalTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CreatorGoalType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CreatorGoalType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CreatorGoalTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs new file mode 100644 index 0000000000..84e15e6854 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.CustomRewardRedemptionStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.CustomRewardRedemptionStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class CustomRewardRedemptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.CustomRewardRedemptionStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.CustomRewardRedemptionStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.CustomRewardRedemptionStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.CustomRewardRedemptionStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.CustomRewardRedemptionStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs new file mode 100644 index 0000000000..0532bd594e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DropsEntitlementFulfillmentStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DropsEntitlementFulfillmentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DropsEntitlementFulfillmentStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DropsEntitlementFulfillmentStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DropsEntitlementFulfillmentStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DropsEntitlementFulfillmentStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DropsEntitlementFulfillmentStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs new file mode 100644 index 0000000000..0d97a05735 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.DropsEntitlementUpdatedStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.DropsEntitlementUpdatedStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class DropsEntitlementUpdatedStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.DropsEntitlementUpdatedStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.DropsEntitlementUpdatedStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.DropsEntitlementUpdatedStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.DropsEntitlementUpdatedStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.DropsEntitlementUpdatedStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a5301a418e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteEmoteTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EmoteEmoteTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EmoteEmoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EmoteEmoteType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EmoteEmoteTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EmoteEmoteType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EmoteEmoteType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EmoteEmoteTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs new file mode 100644 index 0000000000..1b39ebf506 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EmoteFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EmoteFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EmoteFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EmoteFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EmoteFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EmoteFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EmoteFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs new file mode 100644 index 0000000000..a88a949272 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteScaleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EmoteScaleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EmoteScaleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EmoteScale? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EmoteScaleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EmoteScale)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EmoteScale? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EmoteScaleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs new file mode 100644 index 0000000000..770102f4b3 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EmoteThemeModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EmoteThemeModeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EmoteThemeModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EmoteThemeMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EmoteThemeModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EmoteThemeMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EmoteThemeMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EmoteThemeModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs new file mode 100644 index 0000000000..24305a9b7d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPollBodyStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EndPollBodyStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EndPollBodyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EndPollBodyStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EndPollBodyStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EndPollBodyStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EndPollBodyStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EndPollBodyStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs new file mode 100644 index 0000000000..542f8a2686 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EndPredictionBodyStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EndPredictionBodyStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EndPredictionBodyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EndPredictionBodyStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EndPredictionBodyStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EndPredictionBodyStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EndPredictionBodyStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EndPredictionBodyStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs new file mode 100644 index 0000000000..f20a15f5c4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EventSubSubscriptionStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EventSubSubscriptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EventSubSubscriptionStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EventSubSubscriptionStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EventSubSubscriptionStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EventSubSubscriptionStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EventSubSubscriptionStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs new file mode 100644 index 0000000000..ff20927bc9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTransportMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EventSubSubscriptionTransportMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EventSubSubscriptionTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EventSubSubscriptionTransportMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EventSubSubscriptionTransportMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EventSubSubscriptionTransportMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EventSubSubscriptionTransportMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EventSubSubscriptionTransportMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs new file mode 100644 index 0000000000..7516335698 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.EventSubSubscriptionTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.EventSubSubscriptionTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class EventSubSubscriptionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.EventSubSubscriptionType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.EventSubSubscriptionTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.EventSubSubscriptionType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.EventSubSubscriptionType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.EventSubSubscriptionTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs new file mode 100644 index 0000000000..7890416aeb --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionBitsProductCostTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionBitsProductCostTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionBitsProductCostTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionBitsProductCostType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionBitsProductCostTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionBitsProductCostType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionBitsProductCostType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionBitsProductCostTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs new file mode 100644 index 0000000000..d743f570b9 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationLocationNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionConfigurationLocationNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionConfigurationLocationNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionConfigurationLocation? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionConfigurationLocationExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionConfigurationLocation)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionConfigurationLocation? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionConfigurationLocationExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs new file mode 100644 index 0000000000..8275d28b73 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionConfigurationSegmentSegmentNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionConfigurationSegmentSegmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionConfigurationSegmentSegment? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionConfigurationSegmentSegmentExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionConfigurationSegmentSegment)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionConfigurationSegmentSegment? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionConfigurationSegmentSegmentExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs new file mode 100644 index 0000000000..185c59567a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionStateNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionStateNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionStateNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionState? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionStateExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionState)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionState? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionStateExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs new file mode 100644 index 0000000000..6d6c89c2ff --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionSubscriptionsSupportLevelNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionSubscriptionsSupportLevelNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionSubscriptionsSupportLevel? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionSubscriptionsSupportLevelExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionSubscriptionsSupportLevel)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionSubscriptionsSupportLevel? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionSubscriptionsSupportLevelExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs new file mode 100644 index 0000000000..924239c721 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionTransactionProductDataCostTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionTransactionProductDataCostTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionTransactionProductDataCostType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionTransactionProductDataCostTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionTransactionProductDataCostType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionTransactionProductDataCostType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionTransactionProductDataCostTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs new file mode 100644 index 0000000000..13efabbd43 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ExtensionTransactionProductTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ExtensionTransactionProductTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ExtensionTransactionProductTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ExtensionTransactionProductType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ExtensionTransactionProductTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ExtensionTransactionProductType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ExtensionTransactionProductType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ExtensionTransactionProductTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs new file mode 100644 index 0000000000..4fc0d7b35b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetBitsLeaderboardPeriodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetBitsLeaderboardPeriodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetBitsLeaderboardPeriodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetBitsLeaderboardPeriod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetBitsLeaderboardPeriodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetBitsLeaderboardPeriod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetBitsLeaderboardPeriod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetBitsLeaderboardPeriodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs new file mode 100644 index 0000000000..4590c98205 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetChannelGuestStarSettingsResponseGroupLayoutNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetChannelGuestStarSettingsResponseGroupLayoutNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetChannelGuestStarSettingsResponseGroupLayout? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetChannelGuestStarSettingsResponseGroupLayoutExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetChannelGuestStarSettingsResponseGroupLayout)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetChannelGuestStarSettingsResponseGroupLayout? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetChannelGuestStarSettingsResponseGroupLayoutExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs new file mode 100644 index 0000000000..a051300263 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetConduitShardsResponseDataStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetConduitShardsResponseDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetConduitShardsResponseDataStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetConduitShardsResponseDataStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetConduitShardsResponseDataStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetConduitShardsResponseDataStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetConduitShardsResponseDataStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs new file mode 100644 index 0000000000..4b035566c2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetConduitShardsResponseDataTransportMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetConduitShardsResponseDataTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetConduitShardsResponseDataTransportMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetConduitShardsResponseDataTransportMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetConduitShardsResponseDataTransportMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetConduitShardsResponseDataTransportMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetConduitShardsResponseDataTransportMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs new file mode 100644 index 0000000000..52a6badd02 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionSortNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetCustomRewardRedemptionSortNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetCustomRewardRedemptionSortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetCustomRewardRedemptionSort? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetCustomRewardRedemptionSortExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetCustomRewardRedemptionSort)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetCustomRewardRedemptionSort? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetCustomRewardRedemptionSortExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs new file mode 100644 index 0000000000..0f527659e0 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetCustomRewardRedemptionStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetCustomRewardRedemptionStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetCustomRewardRedemptionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetCustomRewardRedemptionStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetCustomRewardRedemptionStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetCustomRewardRedemptionStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetCustomRewardRedemptionStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetCustomRewardRedemptionStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs new file mode 100644 index 0000000000..2a707205dc --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetDropsEntitlementsFulfillmentStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetDropsEntitlementsFulfillmentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetDropsEntitlementsFulfillmentStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetDropsEntitlementsFulfillmentStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetDropsEntitlementsFulfillmentStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetDropsEntitlementsFulfillmentStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetDropsEntitlementsFulfillmentStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs new file mode 100644 index 0000000000..6ed5fece00 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetEventsubSubscriptionsStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetEventsubSubscriptionsStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetEventsubSubscriptionsStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetEventsubSubscriptionsStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetEventsubSubscriptionsStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetEventsubSubscriptionsStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetEventsubSubscriptionsStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..fe4c5915c1 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetEventsubSubscriptionsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetEventsubSubscriptionsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetEventsubSubscriptionsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetEventsubSubscriptionsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetEventsubSubscriptionsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetEventsubSubscriptionsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetEventsubSubscriptionsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetEventsubSubscriptionsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..53cb2fa020 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionAnalyticsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetExtensionAnalyticsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetExtensionAnalyticsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetExtensionAnalyticsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetExtensionAnalyticsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetExtensionAnalyticsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetExtensionAnalyticsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetExtensionAnalyticsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs new file mode 100644 index 0000000000..f7e6cdaca6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetExtensionConfigurationSegmentSegmentNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetExtensionConfigurationSegmentSegmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetExtensionConfigurationSegmentSegment? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetExtensionConfigurationSegmentSegmentExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetExtensionConfigurationSegmentSegment)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetExtensionConfigurationSegmentSegment? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetExtensionConfigurationSegmentSegmentExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..ee848c5475 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetGameAnalyticsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetGameAnalyticsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetGameAnalyticsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetGameAnalyticsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetGameAnalyticsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetGameAnalyticsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetGameAnalyticsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetGameAnalyticsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..2bad6c5bb8 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetStreamsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetStreamsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetStreamsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetStreamsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetStreamsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetStreamsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetStreamsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetStreamsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetUserEmotesResponseDataEmoteTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetUserEmotesResponseDataEmoteTypeNullable.g.verified.cs new file mode 100644 index 0000000000..0dad33e931 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetUserEmotesResponseDataEmoteTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetUserEmotesResponseDataEmoteTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetUserEmotesResponseDataEmoteTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetUserEmotesResponseDataEmoteType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetUserEmotesResponseDataEmoteTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetUserEmotesResponseDataEmoteType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetUserEmotesResponseDataEmoteType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetUserEmotesResponseDataEmoteTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosPeriodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosPeriodNullable.g.verified.cs new file mode 100644 index 0000000000..4e3e832982 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosPeriodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetVideosPeriodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetVideosPeriodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetVideosPeriod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetVideosPeriodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetVideosPeriod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetVideosPeriod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetVideosPeriodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosSortNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosSortNullable.g.verified.cs new file mode 100644 index 0000000000..c275de7058 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosSortNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetVideosSortNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetVideosSortNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetVideosSort? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetVideosSortExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetVideosSort)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetVideosSort? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetVideosSortExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosTypeNullable.g.verified.cs new file mode 100644 index 0000000000..7fcf5a7195 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GetVideosTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GetVideosTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GetVideosTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GetVideosType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GetVideosTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GetVideosType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GetVideosType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GetVideosTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteFormatNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteFormatNullable.g.verified.cs new file mode 100644 index 0000000000..47f7e832b3 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteFormatNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GlobalEmoteFormatNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GlobalEmoteFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GlobalEmoteFormat? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GlobalEmoteFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GlobalEmoteFormat)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GlobalEmoteFormat? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GlobalEmoteFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteScaleNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteScaleNullable.g.verified.cs new file mode 100644 index 0000000000..7f18721d02 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteScaleNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GlobalEmoteScaleNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GlobalEmoteScaleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GlobalEmoteScale? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GlobalEmoteScaleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GlobalEmoteScale)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GlobalEmoteScale? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GlobalEmoteScaleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteThemeModeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteThemeModeNullable.g.verified.cs new file mode 100644 index 0000000000..816f9ec6de --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.GlobalEmoteThemeModeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.GlobalEmoteThemeModeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class GlobalEmoteThemeModeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.GlobalEmoteThemeMode? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.GlobalEmoteThemeModeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.GlobalEmoteThemeMode)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.GlobalEmoteThemeMode? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.GlobalEmoteThemeModeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataLastContributionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataLastContributionTypeNullable.g.verified.cs new file mode 100644 index 0000000000..19a2191c6b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataLastContributionTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.HypeTrainEventEventDataLastContributionTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class HypeTrainEventEventDataLastContributionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.HypeTrainEventEventDataLastContributionType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.HypeTrainEventEventDataLastContributionTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.HypeTrainEventEventDataLastContributionType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.HypeTrainEventEventDataLastContributionType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.HypeTrainEventEventDataLastContributionTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullable.g.verified.cs new file mode 100644 index 0000000000..5acc0b7715 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.HypeTrainEventEventDataTopContributionsTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class HypeTrainEventEventDataTopContributionsTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.HypeTrainEventEventDataTopContributionsType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.HypeTrainEventEventDataTopContributionsTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.HypeTrainEventEventDataTopContributionsType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.HypeTrainEventEventDataTopContributionsType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.HypeTrainEventEventDataTopContributionsTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ManageHeldAutoModMessagesBodyActionNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ManageHeldAutoModMessagesBodyActionNullable.g.verified.cs new file mode 100644 index 0000000000..fb525e9183 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ManageHeldAutoModMessagesBodyActionNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ManageHeldAutoModMessagesBodyActionNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ManageHeldAutoModMessagesBodyActionNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ManageHeldAutoModMessagesBodyAction? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ManageHeldAutoModMessagesBodyActionExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ManageHeldAutoModMessagesBodyAction)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ManageHeldAutoModMessagesBodyAction? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ManageHeldAutoModMessagesBodyActionExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullable.g.verified.cs new file mode 100644 index 0000000000..371eb144f7 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.ModifyChannelInformationBodyContentClassificationLabelsIdNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class ModifyChannelInformationBodyContentClassificationLabelsIdNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.ModifyChannelInformationBodyContentClassificationLabelsId? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.ModifyChannelInformationBodyContentClassificationLabelsIdExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.ModifyChannelInformationBodyContentClassificationLabelsId)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.ModifyChannelInformationBodyContentClassificationLabelsId? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.ModifyChannelInformationBodyContentClassificationLabelsIdExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PollStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PollStatusNullable.g.verified.cs new file mode 100644 index 0000000000..e85a5212f4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PollStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PollStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PollStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PollStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PollStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PollStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PollStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PollStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionOutcomeColorNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionOutcomeColorNullable.g.verified.cs new file mode 100644 index 0000000000..8f9e9348d6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionOutcomeColorNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PredictionOutcomeColorNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PredictionOutcomeColorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PredictionOutcomeColor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PredictionOutcomeColorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PredictionOutcomeColor)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PredictionOutcomeColor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PredictionOutcomeColorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionStatusNullable.g.verified.cs new file mode 100644 index 0000000000..c4887db366 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.PredictionStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.PredictionStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class PredictionStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.PredictionStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.PredictionStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.PredictionStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.PredictionStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.PredictionStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendChatAnnouncementBodyColorNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendChatAnnouncementBodyColorNullable.g.verified.cs new file mode 100644 index 0000000000..c38fbdb1aa --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendChatAnnouncementBodyColorNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SendChatAnnouncementBodyColorNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SendChatAnnouncementBodyColorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SendChatAnnouncementBodyColor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SendChatAnnouncementBodyColorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SendChatAnnouncementBodyColor)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SendChatAnnouncementBodyColor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SendChatAnnouncementBodyColorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendExtensionPubSubMessageBodyTargetNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendExtensionPubSubMessageBodyTargetNullable.g.verified.cs new file mode 100644 index 0000000000..b25d73974e --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SendExtensionPubSubMessageBodyTargetNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SendExtensionPubSubMessageBodyTargetNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SendExtensionPubSubMessageBodyTargetNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SendExtensionPubSubMessageBodyTarget? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SendExtensionPubSubMessageBodyTargetExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SendExtensionPubSubMessageBodyTarget)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SendExtensionPubSubMessageBodyTarget? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SendExtensionPubSubMessageBodyTargetExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullable.g.verified.cs new file mode 100644 index 0000000000..d15aa879eb --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.SetExtensionConfigurationSegmentBodySegmentNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class SetExtensionConfigurationSegmentBodySegmentNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.SetExtensionConfigurationSegmentBodySegment? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.SetExtensionConfigurationSegmentBodySegmentExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.SetExtensionConfigurationSegmentBodySegment)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.SetExtensionConfigurationSegmentBodySegment? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.SetExtensionConfigurationSegmentBodySegmentExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.StreamTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.StreamTypeNullable.g.verified.cs new file mode 100644 index 0000000000..5f73e2d09d --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.StreamTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.StreamTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class StreamTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.StreamType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.StreamTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.StreamType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.StreamType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.StreamTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullable.g.verified.cs new file mode 100644 index 0000000000..873c5b65d4 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateChannelGuestStarSettingsBodyGroupLayoutNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateChannelGuestStarSettingsBodyGroupLayoutNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateChannelGuestStarSettingsBodyGroupLayout? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateChannelGuestStarSettingsBodyGroupLayoutExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateChannelGuestStarSettingsBodyGroupLayout)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateChannelGuestStarSettingsBodyGroupLayout? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateChannelGuestStarSettingsBodyGroupLayoutExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullable.g.verified.cs new file mode 100644 index 0000000000..e2d7b19d92 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateConduitShardsBodyShardsTransportMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateConduitShardsBodyShardsTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateConduitShardsBodyShardsTransportMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateConduitShardsBodyShardsTransportMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateConduitShardsBodyShardsTransportMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateConduitShardsBodyShardsTransportMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateConduitShardsBodyShardsTransportMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataStatusNullable.g.verified.cs new file mode 100644 index 0000000000..e765530bb2 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateConduitShardsResponseDataStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateConduitShardsResponseDataStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateConduitShardsResponseDataStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateConduitShardsResponseDataStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateConduitShardsResponseDataStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateConduitShardsResponseDataStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateConduitShardsResponseDataStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullable.g.verified.cs new file mode 100644 index 0000000000..940aba048a --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateConduitShardsResponseDataTransportMethodNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateConduitShardsResponseDataTransportMethodNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateConduitShardsResponseDataTransportMethod? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateConduitShardsResponseDataTransportMethodExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateConduitShardsResponseDataTransportMethod)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateConduitShardsResponseDataTransportMethod? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateConduitShardsResponseDataTransportMethodExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullable.g.verified.cs new file mode 100644 index 0000000000..cf69d8e27b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateDropsEntitlementsBodyFulfillmentStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateDropsEntitlementsBodyFulfillmentStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateDropsEntitlementsBodyFulfillmentStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateDropsEntitlementsBodyFulfillmentStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateDropsEntitlementsBodyFulfillmentStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateDropsEntitlementsBodyFulfillmentStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateDropsEntitlementsBodyFulfillmentStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullable.g.verified.cs new file mode 100644 index 0000000000..98b8e7466b --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateExtensionBitsProductBodyCostTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateExtensionBitsProductBodyCostTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateExtensionBitsProductBodyCostType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateExtensionBitsProductBodyCostTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateExtensionBitsProductBodyCostType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateExtensionBitsProductBodyCostType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateExtensionBitsProductBodyCostTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateRedemptionStatusBodyStatusNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateRedemptionStatusBodyStatusNullable.g.verified.cs new file mode 100644 index 0000000000..2f48c98be1 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateRedemptionStatusBodyStatusNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateRedemptionStatusBodyStatusNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateRedemptionStatusBodyStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateRedemptionStatusBodyStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateRedemptionStatusBodyStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateRedemptionStatusBodyStatus)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateRedemptionStatusBodyStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateRedemptionStatusBodyStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateUserChatColorColorNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateUserChatColorColorNullable.g.verified.cs new file mode 100644 index 0000000000..a4f5ca525c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UpdateUserChatColorColorNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UpdateUserChatColorColorNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UpdateUserChatColorColorNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UpdateUserChatColorColor? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UpdateUserChatColorColorExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UpdateUserChatColorColor)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UpdateUserChatColorColor? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UpdateUserChatColorColorExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserBroadcasterTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserBroadcasterTypeNullable.g.verified.cs new file mode 100644 index 0000000000..a1700eae4c --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserBroadcasterTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UserBroadcasterTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UserBroadcasterTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UserBroadcasterType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UserBroadcasterTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UserBroadcasterType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UserBroadcasterType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UserBroadcasterTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserExtensionTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserExtensionTypeNullable.g.verified.cs new file mode 100644 index 0000000000..bf2c7179ef --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserExtensionTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UserExtensionTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UserExtensionTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UserExtensionType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UserExtensionTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UserExtensionType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UserExtensionType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UserExtensionTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserSubscriptionTierNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserSubscriptionTierNullable.g.verified.cs new file mode 100644 index 0000000000..68f772a588 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserSubscriptionTierNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UserSubscriptionTierNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UserSubscriptionTierNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UserSubscriptionTier? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UserSubscriptionTierExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UserSubscriptionTier)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UserSubscriptionTier? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UserSubscriptionTierExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserTypeNullable.g.verified.cs new file mode 100644 index 0000000000..9220c20dd0 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.UserTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.UserTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class UserTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.UserType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.UserTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.UserType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.UserType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.UserTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.VideoTypeNullable.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.VideoTypeNullable.g.verified.cs new file mode 100644 index 0000000000..be2cc720b6 --- /dev/null +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/Twitch/SystemTextJson/_#JsonConverters.VideoTypeNullable.g.verified.cs @@ -0,0 +1,57 @@ +//HintName: JsonConverters.VideoTypeNullable.g.cs +#nullable enable + +namespace OpenApiGenerator.JsonConverters +{ + /// + public sealed class VideoTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::G.VideoType? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::G.VideoTypeExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::G.VideoType)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::G.VideoType? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::G.VideoTypeExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs index e132eeb802..702c338055 100644 --- a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs +++ b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.AnyOf.cs @@ -1,4 +1,5 @@ using System.Text.Json; +using System.Text.Json.Serialization; using OpenApiGenerator.JsonConverters; using JsonSerializer = System.Text.Json.JsonSerializer; @@ -6,11 +7,22 @@ namespace OpenApiGenerator.UnitTests; public partial class JsonTests { + private readonly JsonSerializerOptions _defaultSystemTextJsonOptions = new() + { + PropertyNameCaseInsensitive = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + Converters = + { + new TestEnumJsonStringEnumConverter(), + new TestEnumNullableJsonStringEnumConverter(), + } + }; + [TestMethod] public void Enum2_AnyOfStringAndEnum_SystemTextJson_String() { const string json = "{\"status\":\"pulling 797b70c4edf8\",\"digest\":\"sha256:797b70c4edf85907fe0a49eb85811256f65fa0f7bf52166b147fd16be2be4662\",\"total\":45949216}"; - var response = JsonSerializer.Deserialize(json); + var response = JsonSerializer.Deserialize(json, _defaultSystemTextJsonOptions); response.Should().NotBeNull(); response!.Status.Value1.Should().Be(null); response.Status.Value2.Should().Be("pulling 797b70c4edf8"); @@ -18,11 +30,11 @@ public void Enum2_AnyOfStringAndEnum_SystemTextJson_String() var response2 = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOf); response2.Should().NotBeNull(); - response2!.Status.Value1.Should().Be(default); // TODO: Should be nullable + response2!.Status.Value1.Should().Be(null); response2.Status.Value2.Should().Be("pulling 797b70c4edf8"); response2.Status.Object.Should().Be("pulling 797b70c4edf8"); - var responseReverted = JsonSerializer.Deserialize(json); + var responseReverted = JsonSerializer.Deserialize(json, _defaultSystemTextJsonOptions); responseReverted.Should().NotBeNull(); responseReverted!.Status.Value2.Should().Be(null); responseReverted.Status.Value1.Should().Be("pulling 797b70c4edf8"); @@ -30,26 +42,17 @@ public void Enum2_AnyOfStringAndEnum_SystemTextJson_String() var responseReverted2 = JsonSerializer.Deserialize(json, TestSourceGenerationContext.Default.TestEnumClassAnyOfReverted); responseReverted2.Should().NotBeNull(); - responseReverted2!.Status.Value2.Should().Be(default); // TODO: Should be nullable + responseReverted2!.Status.Value2.Should().Be(null); responseReverted2.Status.Value1.Should().Be("pulling 797b70c4edf8"); - responseReverted2.Status.Object.Should().Be(default(TestEnum)); // TODO: Should be nullable + responseReverted2.Status.Object.Should().Be("pulling 797b70c4edf8"); } [TestMethod] public void Enum2_AnyOfStringAndEnum_SystemTextJson_Enum() { const string json = "{\"status\":\"pulling manifest\",\"digest\":\"sha256:797b70c4edf85907fe0a49eb85811256f65fa0f7bf52166b147fd16be2be4662\",\"total\":45949216}"; - var options = new global::System.Text.Json.JsonSerializerOptions - { - PropertyNameCaseInsensitive = true, - DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, - Converters = - { - new TestEnumJsonStringEnumConverter(), - } - }; - var response = JsonSerializer.Deserialize(json, options); + var response = JsonSerializer.Deserialize(json, _defaultSystemTextJsonOptions); response.Should().NotBeNull(); response!.Status.Value1.Should().Be(TestEnum.PullingManifest); response.Status.Value2.Should().Be("pulling manifest"); @@ -67,7 +70,7 @@ public void Enum2_AnyOfStringAndEnum_SystemTextJson_Enum() responseReverted.Status.Value1.Should().Be("pulling manifest"); responseReverted.Status.Object.Should().Be(TestEnum.PullingManifest); - var responseReverted2 = JsonSerializer.Deserialize(json, options); + var responseReverted2 = JsonSerializer.Deserialize(json, _defaultSystemTextJsonOptions); responseReverted2.Should().NotBeNull(); responseReverted2!.Status.Value2.Should().Be(TestEnum.PullingManifest); responseReverted2.Status.Value1.Should().Be("pulling manifest"); diff --git a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs index 811122ce2b..324a3d8b55 100644 --- a/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs +++ b/src/tests/OpenApiGenerator.UnitTests/JsonTests.Enum.New.cs @@ -42,7 +42,8 @@ public void Enum2_SystemTextJson_SourceGenerationContext() DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, Converters = [ - typeof(TestEnumJsonStringEnumConverter) + typeof(TestEnumJsonStringEnumConverter), + typeof(TestEnumNullableJsonStringEnumConverter), ])] [JsonSerializable(typeof(TestEnumClass))] [JsonSerializable(typeof(TestEnumClassAnyOf))] diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt index 985d88c243..a6a6ff0fc4 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/Methods/_.verified.txt @@ -861,7 +861,9 @@ AdditionalTypes: null, Converters: [ global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeJsonConverter, - global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter + global::OpenApiGenerator.JsonConverters.RunCreateSchemaExtendedRunTypeNullableJsonConverter, + global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunCreateSchemaRunTypeNullableJsonConverter ], MethodName: MainConstructorAsync, NotAsyncMethodName: MainConstructor, diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt index 490df2cfac..0b1be2fc83 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/Methods/_.verified.txt @@ -2280,11 +2280,17 @@ If `false` the response will be returned as a single response object, otherwise AdditionalTypes: null, Converters: [ global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.GenerateCompletionRequestFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.GenerateChatCompletionRequestFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModelResponseStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.PullModelResponseStatusJsonConverter, - global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter + global::OpenApiGenerator.JsonConverters.PullModelResponseStatusNullableJsonConverter, + global::OpenApiGenerator.JsonConverters.PushModelResponseStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.PushModelResponseStatusNullableJsonConverter ], MethodName: MainConstructorAsync, NotAsyncMethodName: MainConstructor, diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt index fe07095b6f..03fd7fe5a4 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/Methods/_.verified.txt @@ -13215,175 +13215,345 @@ Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/re AdditionalTypes: null, Converters: [ global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListModelsResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionResponseChoicesFinishReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateCompletionResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageImageUrlDetailNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartImageTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestMessageContentPartTextTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestSystemMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestUserMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestAssistantMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestToolMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionRequestFunctionMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionToolTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionNamedToolChoiceTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionMessageToolCallChunkTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionResponseMessageRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.ChatCompletionStreamResponseDeltaRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestResponseFormatTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestToolChoiceNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionRequestFunctionCallNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseChoicesFinishReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseChoicesFinishReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionFunctionResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListPaginatedFineTuningJobsResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseChoicesFinishReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateChatCompletionStreamResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestQualityNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestSizeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestStyleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestSizeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageEditRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestSizeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateImageVariationRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModerationRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFileRequestPurposeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteFileResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersBatchSizeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersLearningRateMultiplierNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestHyperparametersNEpochsNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestIntegrationsTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateFineTuningJobRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFineTuningJobEventsResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFineTuningJobCheckpointsResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestEncodingFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateEmbeddingResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranscriptionRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateTranslationRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestVoiceNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateSpeechRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ModelObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ModelObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.OpenAIFileObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFileObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFilePurposeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.OpenAIFileStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.OpenAIFileStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.EmbeddingObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.EmbeddingObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobHyperparametersNEpochsNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningIntegrationTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobEventLevelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobEventObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.FineTuningJobCheckpointObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantObjectResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateAssistantRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateAssistantRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.ModifyAssistantRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteAssistantResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsCodeTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsFileSearchTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantToolsFunctionTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.TruncationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.TruncationObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.AssistantsNamedToolChoiceTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectRequiredActionTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectLastErrorCodeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectIncompleteDetailsReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectToolChoiceNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.RunObjectResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateRunRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestToolChoiceNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateRunRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunToolCallObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestModelNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestToolChoiceNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateThreadAndRunRequestResponseFormatNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ThreadObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ThreadObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteThreadResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectIncompleteDetailsReasonNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageObjectRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageObjectRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaObjectDeltaRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateMessageRequestRoleNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteMessageResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectImageFileDetailNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageFileObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectImageFileDetailNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageFileObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectImageUrlDetailNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentImageUrlObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectImageUrlDetailNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentImageUrlObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageRequestContentTextObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageContentTextAnnotationsFilePathObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFileCitationObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.MessageDeltaContentTextAnnotationsFilePathObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectLastErrorCodeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsMessageCreationObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsMessageCreationObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFileSearchObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.RunStepDeltaStepDetailsToolCallsFunctionObjectTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreExpirationAfterAnchorNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteVectorStoreResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectLastErrorCodeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.DeleteVectorStoreFileResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.VectorStoreFileBatchObjectStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ErrorEventEventJsonConverter, + global::OpenApiGenerator.JsonConverters.ErrorEventEventNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DoneEventEventJsonConverter, + global::OpenApiGenerator.JsonConverters.DoneEventEventNullableJsonConverter, global::OpenApiGenerator.JsonConverters.DoneEventDataJsonConverter, + global::OpenApiGenerator.JsonConverters.DoneEventDataNullableJsonConverter, global::OpenApiGenerator.JsonConverters.BatchObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.BatchStatusJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchStatusNullableJsonConverter, global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodJsonConverter, + global::OpenApiGenerator.JsonConverters.BatchRequestInputMethodNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectJsonConverter, + global::OpenApiGenerator.JsonConverters.ListBatchesResponseObjectNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListAssistantsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListAssistantsOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListMessagesOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListMessagesOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListRunsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListRunsOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListRunStepsOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListRunStepsOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoresOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.ListVectorStoreFilesFilterNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchOrderNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.ListFilesInVectorStoreBatchFilterNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointJsonConverter, - global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter + global::OpenApiGenerator.JsonConverters.CreateBatchRequestEndpointNullableJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateBatchRequestCompletionWindowNullableJsonConverter ], MethodName: MainConstructorAsync, NotAsyncMethodName: MainConstructor, diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt index e6fc0a8c62..66ac254df3 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Replicate/Methods/_.verified.txt @@ -3266,14 +3266,23 @@ Requests for event types `output` and `logs` will be sent at most once every 500 AdditionalTypes: null, Converters: [ global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.PredictionRequestWebhookEventsFilterNullableJsonConverter, global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.TrainingRequestWebhookEventsFilterNullableJsonConverter, global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterJsonConverter, + global::OpenApiGenerator.JsonConverters.VersionPredictionRequestWebhookEventsFilterNullableJsonConverter, global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.GetAccountResponseTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.ListDeploymentsResponseResultsCurrentReleaseCreatedByTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, + global::OpenApiGenerator.JsonConverters.GetDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter, global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeJsonConverter, - global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter + global::OpenApiGenerator.JsonConverters.UpdateDeploymentsResponseCurrentReleaseCreatedByTypeNullableJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityJsonConverter, + global::OpenApiGenerator.JsonConverters.CreateModelsRequestVisibilityNullableJsonConverter ], MethodName: MainConstructorAsync, NotAsyncMethodName: MainConstructor,