From 06bbbd0aa61025947a380bf6b1c7f6b9737714dc Mon Sep 17 00:00:00 2001 From: Armando Belardo <11140328+armandobelardo@users.noreply.github.com> Date: Wed, 1 May 2024 15:42:01 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20filter=20allOf=20schemas=20to=20look=20f?= =?UTF-8?q?or=20objects=20instead=20of=20malformed=20bl=E2=80=A6=20(#3503)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__test__/__snapshots__/hume.test.ts.snap | 474 +++--------------- .../__test__/__snapshots__/hume.test.ts.snap | 424 +++------------- .../__snapshots__/supertokens.test.ts.snap | 28 +- .../src/schema/convertObject.ts | 2 +- .../src/schema/convertSchemas.ts | 2 +- 5 files changed, 152 insertions(+), 778 deletions(-) diff --git a/packages/cli/openapi-ir-to-fern/src/__test__/__snapshots__/hume.test.ts.snap b/packages/cli/openapi-ir-to-fern/src/__test__/__snapshots__/hume.test.ts.snap index 6ab3d603bd6..1e144865b79 100644 --- a/packages/cli/openapi-ir-to-fern/src/__test__/__snapshots__/hume.test.ts.snap +++ b/packages/cli/openapi-ir-to-fern/src/__test__/__snapshots__/hume.test.ts.snap @@ -89,10 +89,18 @@ exports[`open api parser hume docs 1`] = ` "request": { "name": "ListJobsRequest", "query-parameters": { + "direction": { + "docs": "The sort direction.", + "type": "optional", + }, "limit": { "docs": "The maximum number of jobs to include in the response.", "type": "optional", }, + "sort_by": { + "docs": "The job timestamp to sort by.", + "type": "optional", + }, "status": { "allow-multiple": true, "docs": "Include only jobs with these statuses.", @@ -102,6 +110,10 @@ exports[`open api parser hume docs 1`] = ` "docs": "Defaults to the current date and time. See \`when\`.", "type": "optional", }, + "when": { + "docs": "Include only jobs that were created before or after \`timestamp_ms\`.", + "type": "optional", + }, }, }, "response": { @@ -132,12 +144,12 @@ exports[`open api parser hume docs 1`] = ` "docs": "If provided, a \`POST\` request will be made to the URL with the generated predictions on completion or the error message on failure.", "type": "optional", }, - "models": "optional", + "models": "optional", "notify": { "docs": "Whether to send an email notification to the user upon job failure.", "type": "optional", }, - "transcription": "optional", + "transcription": "optional", "urls": { "docs": "URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (\`.zip\`, \`.tar.gz\`, \`.tar.bz2\`, \`.tar.xz\`) of media files. @@ -158,20 +170,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, "types": { - "BaseRequestModels": { - "docs": undefined, - "extends": [ - "Models", - ], - "properties": {}, - }, - "BaseRequestTranscription": { - "docs": undefined, - "extends": [ - "Transcription", - ], - "properties": {}, - }, "Bcp47Tag": { "enum": [ "zh", @@ -344,8 +342,8 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Face": { "docs": undefined, "properties": { - "descriptions": "optional", - "facs": "optional", + "descriptions": "optional", + "facs": "optional", "fps_pred": { "docs": "Number of frames per second to process. Other frames will be omitted from the response. Set to \`0\` to process every frame.", "type": "optional", @@ -368,20 +366,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, }, - "FaceDescriptions": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "FaceFacs": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, "FacePrediction": { "docs": undefined, "properties": { @@ -581,22 +565,15 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Language": { "docs": undefined, "properties": { - "granularity": "optional", + "granularity": "optional", "identify_speakers": { "docs": "Whether to return identifiers for speakers over time. If \`true\`, unique identifiers will be assigned to spoken words to differentiate different speakers. If \`false\`, all speakers will be tagged with an \`unknown\` ID.", "type": "optional", }, - "sentiment": "optional", - "toxicity": "optional", + "sentiment": "optional", + "toxicity": "optional", }, }, - "LanguageGranularity": { - "docs": undefined, - "extends": [ - "Granularity", - ], - "properties": {}, - }, "LanguagePrediction": { "docs": undefined, "properties": { @@ -630,126 +607,28 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana }, }, }, - "LanguageSentiment": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "LanguageToxicity": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, "Models": { "docs": undefined, "properties": { - "burst": "optional", - "face": "optional", - "facemesh": "optional", - "language": "optional", - "ner": "optional", - "prosody": "optional", + "burst": "optional", + "face": "optional", + "facemesh": "optional", + "language": "optional", + "ner": "optional", + "prosody": "optional", }, }, - "ModelsBurst": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "ModelsFace": { - "docs": undefined, - "extends": [ - "Face", - ], - "properties": {}, - }, - "ModelsFacemesh": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "ModelsLanguage": { - "docs": undefined, - "extends": [ - "Language", - ], - "properties": {}, - }, - "ModelsNer": { - "docs": undefined, - "extends": [ - "Ner", - ], - "properties": {}, - }, "ModelsPredictions": { "docs": undefined, "properties": { - "burst": "optional", - "face": "optional", - "facemesh": "optional", - "language": "optional", - "ner": "optional", - "prosody": "optional", + "burst": "optional", + "face": "optional", + "facemesh": "optional", + "language": "optional", + "ner": "optional", + "prosody": "optional", }, }, - "ModelsPredictionsBurst": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullBurstPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsFace": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullFacePrediction", - ], - "properties": {}, - }, - "ModelsPredictionsFacemesh": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullFacemeshPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsLanguage": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataLanguagePrediction", - ], - "properties": {}, - }, - "ModelsPredictionsNer": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataNerPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsProsody": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataProsodyPrediction", - ], - "properties": {}, - }, - "ModelsProsody": { - "docs": undefined, - "extends": [ - "Prosody", - ], - "properties": {}, - }, "Ner": { "docs": undefined, "properties": { @@ -870,21 +749,14 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "Prosody": { "docs": "NOTE: the \`granularity\` field is ignored if transcription is not enabled or if the \`window\` field has been set.", "properties": { - "granularity": "optional", + "granularity": "optional", "identify_speakers": { "docs": "Whether to return identifiers for speakers over time. If \`true\`, unique identifiers will be assigned to spoken words to differentiate different speakers. If \`false\`, all speakers will be tagged with an \`unknown\` ID.", "type": "optional", }, - "window": "optional", + "window": "optional", }, }, - "ProsodyGranularity": { - "docs": undefined, - "extends": [ - "Granularity", - ], - "properties": {}, - }, "ProsodyPrediction": { "docs": undefined, "properties": { @@ -907,13 +779,6 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "time": "TimeInterval", }, }, - "ProsodyWindow": { - "docs": undefined, - "extends": [ - "Window", - ], - "properties": {}, - }, "Queued": { "docs": undefined, "properties": { @@ -931,12 +796,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "type": "optional", }, "files": "list", - "models": "optional", + "models": "optional", "notify": { "docs": "Whether to send an email notification to the user upon job completion/failure.", "type": "optional", }, - "transcription": "optional", + "transcription": "optional", "urls": { "docs": "URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (\`.zip\`, \`.tar.gz\`, \`.tar.bz2\`, \`.tar.xz\`) of media files. @@ -945,20 +810,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, }, - "RequestModels": { - "docs": undefined, - "extends": [ - "Models", - ], - "properties": {}, - }, - "RequestTranscription": { - "docs": undefined, - "extends": [ - "Transcription", - ], - "properties": {}, - }, "Results": { "docs": undefined, "properties": { @@ -1096,16 +947,9 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Transcription": { "docs": undefined, "properties": { - "language": "optional", + "language": "optional", }, }, - "TranscriptionLanguage": { - "docs": undefined, - "extends": [ - "Bcp47Tag", - ], - "properties": {}, - }, "TranscriptionMetadata": { "docs": "Transcription metadata for your media file.", "properties": { @@ -1113,16 +957,9 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "docs": "Value between \`0.0\` and \`1.0\` indicating our transcription model’s relative confidence in the transcription of your media file.", "type": "double", }, - "detected_language": "optional", + "detected_language": "optional", }, }, - "TranscriptionMetadataDetectedLanguage": { - "docs": undefined, - "extends": [ - "Bcp47Tag", - ], - "properties": {}, - }, "Url": { "docs": undefined, "properties": { @@ -1264,10 +1101,18 @@ exports[`open api parser hume simple 1`] = ` "request": { "name": "ListJobsRequest", "query-parameters": { + "direction": { + "docs": "The sort direction.", + "type": "optional", + }, "limit": { "docs": "The maximum number of jobs to include in the response.", "type": "optional", }, + "sort_by": { + "docs": "The job timestamp to sort by.", + "type": "optional", + }, "status": { "allow-multiple": true, "docs": "Include only jobs with these statuses.", @@ -1277,6 +1122,10 @@ exports[`open api parser hume simple 1`] = ` "docs": "Defaults to the current date and time. See \`when\`.", "type": "optional", }, + "when": { + "docs": "Include only jobs that were created before or after \`timestamp_ms\`.", + "type": "optional", + }, }, }, "response": { @@ -1307,12 +1156,12 @@ exports[`open api parser hume simple 1`] = ` "docs": "If provided, a \`POST\` request will be made to the URL with the generated predictions on completion or the error message on failure.", "type": "optional", }, - "models": "optional", + "models": "optional", "notify": { "docs": "Whether to send an email notification to the user upon job failure.", "type": "optional", }, - "transcription": "optional", + "transcription": "optional", "urls": { "docs": "URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (\`.zip\`, \`.tar.gz\`, \`.tar.bz2\`, \`.tar.xz\`) of media files. @@ -1333,20 +1182,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, "types": { - "BaseRequestModels": { - "docs": undefined, - "extends": [ - "Models", - ], - "properties": {}, - }, - "BaseRequestTranscription": { - "docs": undefined, - "extends": [ - "Transcription", - ], - "properties": {}, - }, "Bcp47Tag": { "enum": [ "zh", @@ -1519,8 +1354,8 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Face": { "docs": undefined, "properties": { - "descriptions": "optional", - "facs": "optional", + "descriptions": "optional", + "facs": "optional", "fps_pred": { "docs": "Number of frames per second to process. Other frames will be omitted from the response. Set to \`0\` to process every frame.", "type": "optional", @@ -1543,20 +1378,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, }, - "FaceDescriptions": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "FaceFacs": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, "FacePrediction": { "docs": undefined, "properties": { @@ -1756,22 +1577,15 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Language": { "docs": undefined, "properties": { - "granularity": "optional", + "granularity": "optional", "identify_speakers": { "docs": "Whether to return identifiers for speakers over time. If \`true\`, unique identifiers will be assigned to spoken words to differentiate different speakers. If \`false\`, all speakers will be tagged with an \`unknown\` ID.", "type": "optional", }, - "sentiment": "optional", - "toxicity": "optional", + "sentiment": "optional", + "toxicity": "optional", }, }, - "LanguageGranularity": { - "docs": undefined, - "extends": [ - "Granularity", - ], - "properties": {}, - }, "LanguagePrediction": { "docs": undefined, "properties": { @@ -1805,126 +1619,28 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana }, }, }, - "LanguageSentiment": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "LanguageToxicity": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, "Models": { "docs": undefined, "properties": { - "burst": "optional", - "face": "optional", - "facemesh": "optional", - "language": "optional", - "ner": "optional", - "prosody": "optional", + "burst": "optional", + "face": "optional", + "facemesh": "optional", + "language": "optional", + "ner": "optional", + "prosody": "optional", }, }, - "ModelsBurst": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "ModelsFace": { - "docs": undefined, - "extends": [ - "Face", - ], - "properties": {}, - }, - "ModelsFacemesh": { - "docs": undefined, - "extends": [ - "Empty", - ], - "properties": {}, - }, - "ModelsLanguage": { - "docs": undefined, - "extends": [ - "Language", - ], - "properties": {}, - }, - "ModelsNer": { - "docs": undefined, - "extends": [ - "Ner", - ], - "properties": {}, - }, "ModelsPredictions": { "docs": undefined, "properties": { - "burst": "optional", - "face": "optional", - "facemesh": "optional", - "language": "optional", - "ner": "optional", - "prosody": "optional", + "burst": "optional", + "face": "optional", + "facemesh": "optional", + "language": "optional", + "ner": "optional", + "prosody": "optional", }, }, - "ModelsPredictionsBurst": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullBurstPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsFace": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullFacePrediction", - ], - "properties": {}, - }, - "ModelsPredictionsFacemesh": { - "docs": undefined, - "extends": [ - "PredictionsOptionalNullFacemeshPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsLanguage": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataLanguagePrediction", - ], - "properties": {}, - }, - "ModelsPredictionsNer": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataNerPrediction", - ], - "properties": {}, - }, - "ModelsPredictionsProsody": { - "docs": undefined, - "extends": [ - "PredictionsOptionalTranscriptionMetadataProsodyPrediction", - ], - "properties": {}, - }, - "ModelsProsody": { - "docs": undefined, - "extends": [ - "Prosody", - ], - "properties": {}, - }, "Ner": { "docs": undefined, "properties": { @@ -2045,21 +1761,14 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "Prosody": { "docs": "NOTE: the \`granularity\` field is ignored if transcription is not enabled or if the \`window\` field has been set.", "properties": { - "granularity": "optional", + "granularity": "optional", "identify_speakers": { "docs": "Whether to return identifiers for speakers over time. If \`true\`, unique identifiers will be assigned to spoken words to differentiate different speakers. If \`false\`, all speakers will be tagged with an \`unknown\` ID.", "type": "optional", }, - "window": "optional", + "window": "optional", }, }, - "ProsodyGranularity": { - "docs": undefined, - "extends": [ - "Granularity", - ], - "properties": {}, - }, "ProsodyPrediction": { "docs": undefined, "properties": { @@ -2082,13 +1791,6 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "time": "TimeInterval", }, }, - "ProsodyWindow": { - "docs": undefined, - "extends": [ - "Window", - ], - "properties": {}, - }, "Queued": { "docs": undefined, "properties": { @@ -2106,12 +1808,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "type": "optional", }, "files": "list", - "models": "optional", + "models": "optional", "notify": { "docs": "Whether to send an email notification to the user upon job completion/failure.", "type": "optional", }, - "transcription": "optional", + "transcription": "optional", "urls": { "docs": "URLs to the media files to be processed. Each must be a valid public URL to a media file (see recommended input filetypes) or an archive (\`.zip\`, \`.tar.gz\`, \`.tar.bz2\`, \`.tar.xz\`) of media files. @@ -2120,20 +1822,6 @@ If you wish to supply more than 100 URLs, consider providing them as an archive }, }, }, - "RequestModels": { - "docs": undefined, - "extends": [ - "Models", - ], - "properties": {}, - }, - "RequestTranscription": { - "docs": undefined, - "extends": [ - "Transcription", - ], - "properties": {}, - }, "Results": { "docs": undefined, "properties": { @@ -2271,16 +1959,9 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "Transcription": { "docs": undefined, "properties": { - "language": "optional", + "language": "optional", }, }, - "TranscriptionLanguage": { - "docs": undefined, - "extends": [ - "Bcp47Tag", - ], - "properties": {}, - }, "TranscriptionMetadata": { "docs": "Transcription metadata for your media file.", "properties": { @@ -2288,16 +1969,9 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "docs": "Value between \`0.0\` and \`1.0\` indicating our transcription model’s relative confidence in the transcription of your media file.", "type": "double", }, - "detected_language": "optional", + "detected_language": "optional", }, }, - "TranscriptionMetadataDetectedLanguage": { - "docs": undefined, - "extends": [ - "Bcp47Tag", - ], - "properties": {}, - }, "Url": { "docs": undefined, "properties": { diff --git a/packages/cli/openapi-parser/src/__test__/__snapshots__/hume.test.ts.snap b/packages/cli/openapi-parser/src/__test__/__snapshots__/hume.test.ts.snap index 44f11c7b514..ff13d21e5cd 100644 --- a/packages/cli/openapi-parser/src/__test__/__snapshots__/hume.test.ts.snap +++ b/packages/cli/openapi-parser/src/__test__/__snapshots__/hume.test.ts.snap @@ -95,22 +95,12 @@ exports[`open api parser hume parse open api 1`] = ` "nameOverride": null, "type": "nullable", "value": { - "allOf": [ - { - "description": null, - "generatedName": "When", - "groupName": null, - "nameOverride": null, - "schema": "When", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ListJobsRequestWhen", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "When", + "type": "reference", }, }, }, @@ -147,22 +137,12 @@ exports[`open api parser hume parse open api 1`] = ` "nameOverride": null, "type": "nullable", "value": { - "allOf": [ - { - "description": null, - "generatedName": "SortBy", - "groupName": null, - "nameOverride": null, - "schema": "SortBy", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ListJobsRequestSortBy", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "SortBy", + "type": "reference", }, }, }, @@ -177,22 +157,12 @@ exports[`open api parser hume parse open api 1`] = ` "nameOverride": null, "type": "nullable", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Direction", - "groupName": null, - "nameOverride": null, - "schema": "Direction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ListJobsRequestDirection", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Direction", + "type": "reference", }, }, }, @@ -502,19 +472,12 @@ exports[`open api parser hume parse open api 1`] = ` "Job_Request", "JobId", "SourceResult", - "Empty", - "Face", - "Granularity", - "Window", - "Prosody", - "Language", - "Ner", "Models", - "Bcp47Tag", "Transcription", "TimeInterval", "EmotionScore", "DescriptionsScore", + "Empty", "BoundingBox", "FacsScore", "BurstPrediction", @@ -525,24 +488,30 @@ exports[`open api parser hume parse open api 1`] = ` "ProsodyPrediction", "Request", "State", + "Granularity", "PositionInterval", "SentimentScore", "ToxicityScore", - "Null", - "GroupedPredictions_FacePrediction", + "Face", + "Prosody", + "Language", + "Ner", "Predictions_optional_Null_FacePrediction", - "GroupedPredictions_BurstPrediction", "Predictions_optional_Null_BurstPrediction", - "TranscriptionMetadata", - "GroupedPredictions_ProsodyPrediction", "Predictions_optional_TranscriptionMetadata_ProsodyPrediction", - "GroupedPredictions_LanguagePrediction", "Predictions_optional_TranscriptionMetadata_LanguagePrediction", - "GroupedPredictions_NerPrediction", "Predictions_optional_TranscriptionMetadata_NerPrediction", - "GroupedPredictions_FacemeshPrediction", "Predictions_optional_Null_FacemeshPrediction", "ModelsPredictions", + "Null", + "GroupedPredictions_BurstPrediction", + "GroupedPredictions_FacePrediction", + "GroupedPredictions_FacemeshPrediction", + "TranscriptionMetadata", + "GroupedPredictions_LanguagePrediction", + "GroupedPredictions_NerPrediction", + "GroupedPredictions_ProsodyPrediction", + "Window", "File", "Prediction", "Error", @@ -553,6 +522,7 @@ exports[`open api parser hume parse open api 1`] = ` "Failed", "InProgress", "Queued", + "Bcp47Tag", ], "schemas": { "BaseRequest": { @@ -575,22 +545,12 @@ exports[`open api parser hume parse open api 1`] = ` "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Models", - "groupName": null, - "nameOverride": null, - "schema": "Models", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "BaseRequestModels", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Models", + "type": "reference", }, }, }, @@ -606,22 +566,12 @@ exports[`open api parser hume parse open api 1`] = ` "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Transcription", - "groupName": null, - "nameOverride": null, - "schema": "Transcription", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "BaseRequestTranscription", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Transcription", + "type": "reference", }, }, }, @@ -1609,22 +1559,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "FaceFacs", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -1640,22 +1580,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "FaceDescriptions", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -2594,22 +2524,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Granularity", - "groupName": null, - "nameOverride": null, - "schema": "Granularity", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "LanguageGranularity", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Granularity", + "type": "reference", }, }, }, @@ -2648,22 +2568,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "LanguageSentiment", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -2679,22 +2589,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "LanguageToxicity", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -2910,22 +2810,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Face", - "groupName": null, - "nameOverride": null, - "schema": "Face", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsFace", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Face", + "type": "reference", }, }, }, @@ -2941,22 +2831,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsBurst", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -2972,22 +2852,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Prosody", - "groupName": null, - "nameOverride": null, - "schema": "Prosody", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsProsody", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Prosody", + "type": "reference", }, }, }, @@ -3003,22 +2873,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Language", - "groupName": null, - "nameOverride": null, - "schema": "Language", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsLanguage", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Language", + "type": "reference", }, }, }, @@ -3034,22 +2894,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Ner", - "groupName": null, - "nameOverride": null, - "schema": "Ner", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsNer", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Ner", + "type": "reference", }, }, }, @@ -3065,22 +2915,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Empty", - "groupName": null, - "nameOverride": null, - "schema": "Empty", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsFacemesh", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Empty", + "type": "reference", }, }, }, @@ -3107,22 +2947,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalNullFacePrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_Null_FacePrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsFace", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_Null_FacePrediction", + "type": "reference", }, }, }, @@ -3138,22 +2968,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalNullBurstPrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_Null_BurstPrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsBurst", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_Null_BurstPrediction", + "type": "reference", }, }, }, @@ -3169,22 +2989,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalTranscriptionMetadataProsodyPrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_TranscriptionMetadata_ProsodyPrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsProsody", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_TranscriptionMetadata_ProsodyPrediction", + "type": "reference", }, }, }, @@ -3200,22 +3010,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalTranscriptionMetadataLanguagePrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_TranscriptionMetadata_LanguagePrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsLanguage", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_TranscriptionMetadata_LanguagePrediction", + "type": "reference", }, }, }, @@ -3231,22 +3031,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalTranscriptionMetadataNerPrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_TranscriptionMetadata_NerPrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsNer", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_TranscriptionMetadata_NerPrediction", + "type": "reference", }, }, }, @@ -3262,22 +3052,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PredictionsOptionalNullFacemeshPrediction", - "groupName": null, - "nameOverride": null, - "schema": "Predictions_optional_Null_FacemeshPrediction", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ModelsPredictionsFacemesh", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Predictions_optional_Null_FacemeshPrediction", + "type": "reference", }, }, }, @@ -3964,22 +3744,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Granularity", - "groupName": null, - "nameOverride": null, - "schema": "Granularity", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ProsodyGranularity", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Granularity", + "type": "reference", }, }, }, @@ -4018,22 +3788,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Window", - "groupName": null, - "nameOverride": null, - "schema": "Window", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "ProsodyWindow", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Window", + "type": "reference", }, }, }, @@ -4204,22 +3964,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Models", - "groupName": null, - "nameOverride": null, - "schema": "Models", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "RequestModels", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Models", + "type": "reference", }, }, }, @@ -4235,22 +3985,12 @@ Compared to returning one estimate of sentiment, this enables a more nuanced ana "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Transcription", - "groupName": null, - "nameOverride": null, - "schema": "Transcription", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "RequestTranscription", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Transcription", + "type": "reference", }, }, }, @@ -4927,22 +4667,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Bcp47Tag", - "groupName": null, - "nameOverride": null, - "schema": "Bcp47Tag", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "TranscriptionLanguage", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Bcp47Tag", + "type": "reference", }, }, }, @@ -4985,22 +4715,12 @@ If you wish to supply more than 100 URLs, consider providing them as an archive "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Bcp47Tag", - "groupName": null, - "nameOverride": null, - "schema": "Bcp47Tag", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "TranscriptionMetadataDetectedLanguage", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "Bcp47Tag", + "type": "reference", }, }, }, diff --git a/packages/cli/openapi-parser/src/__test__/__snapshots__/supertokens.test.ts.snap b/packages/cli/openapi-parser/src/__test__/__snapshots__/supertokens.test.ts.snap index 2dbeff815bf..0ca11903a13 100644 --- a/packages/cli/openapi-parser/src/__test__/__snapshots__/supertokens.test.ts.snap +++ b/packages/cli/openapi-parser/src/__test__/__snapshots__/supertokens.test.ts.snap @@ -6751,22 +6751,12 @@ If the email or phoneNumber is set to null the previous value will be deleted. I "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "Email", - "groupName": null, - "nameOverride": null, - "schema": "email", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "PasswordlessPutUserRequestEmail", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "email", + "type": "reference", }, }, }, @@ -6782,22 +6772,12 @@ If the email or phoneNumber is set to null the previous value will be deleted. I "nameOverride": null, "type": "optional", "value": { - "allOf": [ - { - "description": null, - "generatedName": "PhoneNumber", - "groupName": null, - "nameOverride": null, - "schema": "phoneNumber", - }, - ], - "allOfPropertyConflicts": [], "description": null, "generatedName": "PasswordlessPutUserRequestPhoneNumber", "groupName": null, "nameOverride": null, - "properties": [], - "type": "object", + "schema": "phoneNumber", + "type": "reference", }, }, }, diff --git a/packages/cli/openapi-parser/src/schema/convertObject.ts b/packages/cli/openapi-parser/src/schema/convertObject.ts index 4f26ea44972..d99896ce91f 100644 --- a/packages/cli/openapi-parser/src/schema/convertObject.ts +++ b/packages/cli/openapi-parser/src/schema/convertObject.ts @@ -13,10 +13,10 @@ import { getExtension } from "../getExtension"; import { FernOpenAPIExtension } from "../openapi/v3/extensions/fernExtensions"; import { convertSchema, convertToReferencedSchema, getSchemaIdFromReference } from "./convertSchemas"; import { SchemaParserContext } from "./SchemaParserContext"; +import { getBreadcrumbsFromReference } from "./utils/getBreadcrumbsFromReference"; import { getGeneratedPropertyName } from "./utils/getSchemaName"; import { isReferenceObject } from "./utils/isReferenceObject"; import { isSchemaWithExampleEqual } from "./utils/isSchemaEqual"; -import { getBreadcrumbsFromReference } from "./utils/getBreadcrumbsFromReference"; interface ReferencedAllOfInfo { schemaId: SchemaId; diff --git a/packages/cli/openapi-parser/src/schema/convertSchemas.ts b/packages/cli/openapi-parser/src/schema/convertSchemas.ts index eb3501e63a7..6805a2dde73 100644 --- a/packages/cli/openapi-parser/src/schema/convertSchemas.ts +++ b/packages/cli/openapi-parser/src/schema/convertSchemas.ts @@ -563,7 +563,7 @@ export function convertSchemaObject( for (const allOf of schema.allOf ?? []) { if (isReferenceObject(allOf)) { filteredAllOfs.push(allOf); - } else if (Object.keys(allOf).length > 0) { + } else if (Object.keys(allOf).length > 0 && Object.keys(allOf).includes("type")) { filteredAllOfs.push(allOf); } }