From 8b96a9e231545c6cd8a7c7dab8fb0ccc3ecb593a Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Sat, 19 Oct 2024 10:13:27 -0400 Subject: [PATCH] feat(cli): `fern jsonschema --type ` (#4952) --- generators/commons/package.json | 2 +- generators/csharp/codegen/package.json | 2 +- generators/csharp/model/package.json | 2 +- generators/csharp/sdk/package.json | 2 +- generators/openapi/package.json | 2 +- generators/php/codegen/package.json | 2 +- generators/php/model/package.json | 2 +- generators/php/sdk/package.json | 2 +- generators/postman/package.json | 2 +- .../codegen/.depcheckrc.json | 0 .../codegen/.prettierrc.cjs | 0 .../codegen/package.json | 5 +- .../codegen/src/ast/Class.ts | 0 .../codegen/src/ast/CodeBlock.ts | 0 .../codegen/src/ast/Decorator.ts | 0 .../codegen/src/ast/Field.ts | 0 .../codegen/src/ast/Method.ts | 0 .../codegen/src/ast/MethodArgument.ts | 0 .../codegen/src/ast/MethodInvocation.ts | 0 .../codegen/src/ast/Parameter.ts | 0 .../codegen/src/ast/PythonFile.ts | 0 .../codegen/src/ast/Reference.ts | 0 .../codegen/src/ast/Type.ts | 0 .../codegen/src/ast/__test__/Class.test.ts | 0 .../src/ast/__test__/CodeBlock.test.ts | 0 .../src/ast/__test__/Decorator.test.ts | 0 .../codegen/src/ast/__test__/Field.test.ts | 0 .../codegen/src/ast/__test__/Method.test.ts | 0 .../src/ast/__test__/MethodInvocation.test.ts | 0 .../src/ast/__test__/PythonFile.test.ts | 0 .../src/ast/__test__/Reference.test.ts | 0 .../codegen/src/ast/__test__/Type.test.ts | 0 .../__test__/__snapshots__/Class.test.ts.snap | 0 .../__snapshots__/CodeBlock.test.ts.snap | 0 .../__snapshots__/Decorator.test.ts.snap | 0 .../__test__/__snapshots__/Field.test.ts.snap | 0 .../__snapshots__/Method.test.ts.snap | 0 .../MethodInvocation.test.ts.snap | 0 .../__snapshots__/PythonFile.test.ts.snap | 0 .../__snapshots__/Reference.test.ts.snap | 0 .../__test__/__snapshots__/Type.test.ts.snap | 0 .../codegen/src/ast/core/AstNode.ts | 0 .../codegen/src/ast/core/Writer.ts | 0 .../codegen/src/ast/index.ts | 0 .../codegen/src/index.ts | 0 .../codegen/src/python.ts | 0 .../codegen/tsconfig.json | 0 .../codegen/vitest.config.ts | 0 generators/ruby/cli/package.json | 2 +- generators/ruby/codegen/package.json | 2 +- generators/ruby/model/package.json | 2 +- generators/ruby/sdk/package.json | 2 +- generators/swift/codegen/package.json | 2 +- generators/typescript/codegen/package.json | 2 +- .../typescript/express/cli/package.json | 2 +- .../package.json | 2 +- .../express-error-generator/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../express-register-generator/package.json | 2 +- .../express-service-generator/package.json | 2 +- .../typescript/express/generator/package.json | 2 +- .../package.json | 2 +- .../model/type-generator/package.json | 2 +- .../type-reference-converters/package.json | 2 +- .../package.json | 2 +- .../model/type-schema-generator/package.json | 2 +- .../model/union-generator/package.json | 2 +- .../model/union-schema-generator/package.json | 2 +- .../playground/browser/package.json | 2 +- generators/typescript/sdk/cli/package.json | 2 +- .../sdk/client-class-generator/package.json | 2 +- .../package.json | 2 +- .../sdk/environments-generator/package.json | 2 +- .../typescript/sdk/generator/package.json | 2 +- .../generic-sdk-error-generators/package.json | 2 +- .../request-wrapper-generator/package.json | 2 +- .../package.json | 2 +- .../sdk/sdk-error-generator/package.json | 2 +- .../sdk-error-schema-generator/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../utils/abstract-generator-cli/package.json | 2 +- .../abstract-schema-generator/package.json | 2 +- .../typescript/utils/commons/package.json | 2 +- .../typescript/utils/contexts/package.json | 2 +- .../utils/core-utilities/auth/package.json | 2 +- .../utils/core-utilities/base/package.json | 2 +- .../callback-queue/package.json | 2 +- .../utils/core-utilities/fetcher/package.json | 2 +- .../utils/core-utilities/utils/package.json | 2 +- .../utils/core-utilities/zurg/package.json | 2 +- .../typescript/utils/resolvers/package.json | 2 +- package.json | 2 +- .../cli/api-importers/commons/package.json | 2 +- .../conjure/conjure-sdk/package.json | 2 +- .../conjure-to-fern-tests/package.json | 2 +- .../conjure/conjure-to-fern/package.json | 2 +- .../openapi/openapi-ir-parser/package.json | 2 +- .../openapi-ir-to-fern-tests/package.json | 2 +- .../openapi/openapi-ir-to-fern/package.json | 2 +- .../openapi/openapi-ir/package.json | 2 +- packages/cli/auth/package.json | 2 +- packages/cli/cli-migrations/package.json | 2 +- packages/cli/cli/package.json | 3 +- packages/cli/cli/src/cli.ts | 42 + .../generateJsonschemaForWorkspace.ts | 80 + packages/cli/cli/tsconfig.json | 3 +- packages/cli/cli/versions.yml | 12 + packages/cli/configuration/package.json | 4 +- .../cli/docs-importers/commons/package.json | 2 +- .../cli/docs-importers/mintlify/package.json | 2 +- packages/cli/docs-markdown-utils/package.json | 4 +- packages/cli/docs-preview/package.json | 8 +- packages/cli/docs-resolver/package.json | 8 +- packages/cli/ete-tests/package.json | 4 +- .../help/__snapshots__/help.test.ts.snap | 56 +- .../__snapshots__/jsonschema.test.ts.snap | 28 + .../src/tests/jsonschema/jsonschema.test.ts | 19 + .../fern-definition/formatter/package.json | 2 +- .../ir-to-jsonschema/.depcheckrc.json | 10 + .../ir-to-jsonschema/.prettierrc.cjs | 1 + .../ir-to-jsonschema/package.json | 49 + .../src/JsonSchemaConverterContext.ts | 70 + .../alias-extends/type_:AliasType.json | 16 + .../alias-extends/type_:Child.json | 12 + .../alias-extends/type_:Parent.json | 12 + .../__snapshots__/alias/type_:Object.json | 23 + .../__snapshots__/alias/type_:Type.json | 20 + .../__snapshots__/alias/type_:TypeId.json | 4 + .../any-auth/type_auth:TokenResponse.json | 19 + .../any-auth/type_user:User.json | 16 + .../audiences/type_commons:Imported.json | 4 + .../type_folder-a/service:Response.json | 30 + .../audiences/type_folder-b/common:Foo.json | 22 + .../type_folder-c/common:FolderCFoo.json | 13 + .../type_folder-d/service:Response.json | 12 + .../audiences/type_foo:FilteredType.json | 15 + .../audiences/type_foo:ImportingType.json | 16 + .../audiences/type_foo:OptionalString.json | 4 + ...e_errors:UnauthorizedRequestErrorBody.json | 12 + ...e_errors:UnauthorizedRequestErrorBody.json | 12 + .../type_:ImportingA.json | 14 + .../type_:RootType.json | 12 + .../type_a:A.json | 5 + .../type_ast:ContainerValue.json | 155 ++ .../type_ast:FieldName.json | 4 + .../type_ast:FieldValue.json | 163 ++ .../type_ast:ObjectFieldValue.json | 127 ++ .../type_ast:ObjectValue.json | 5 + .../type_ast:PrimitiveValue.json | 8 + .../circular-references/type_:ImportingA.json | 14 + .../circular-references/type_:RootType.json | 12 + .../circular-references/type_a:A.json | 5 + .../type_ast:ContainerValue.json | 155 ++ .../type_ast:FieldValue.json | 163 ++ .../type_ast:JsonLike.json | 52 + .../type_ast:ObjectValue.json | 5 + .../type_ast:PrimitiveValue.json | 8 + .../type_commons:Imported.json | 4 + .../type_folder-a/service:Response.json | 30 + .../type_folder-b/common:Foo.json | 22 + .../type_folder-c/common:Foo.json | 13 + .../type_folder-d/service:Response.json | 30 + .../type_foo:ImportingType.json | 16 + .../type_foo:OptionalString.json | 4 + .../type_a/aa:A.json | 5 + .../type_a/aa:B.json | 5 + .../type_a/aa:SubTestType.json | 25 + .../type_b:TestType.json | 25 + .../type_tasktest:Task.json | 12 + ...e_errors:UnauthorizedRequestErrorBody.json | 12 + .../__snapshots__/enum/type_:Color.json | 8 + .../enum/type_:ColorOrOperand.json | 27 + .../__snapshots__/enum/type_:Operand.json | 9 + ...ype_errors:PropertyBasedErrorTestBody.json | 12 + .../examples/type_:BasicType.json | 8 + .../examples/type_:ComplexType.json | 9 + .../examples/type_:Identifier.json | 46 + .../__snapshots__/examples/type_:Type.json | 27 + .../examples/type_commons/types:Data.json | 45 + .../type_commons/types:EventInfo.json | 58 + .../examples/type_commons/types:Metadata.json | 21 + .../examples/type_commons/types:Tag.json | 4 + .../examples/type_file/service:Filename.json | 4 + .../examples/type_types:Actor.json | 16 + .../examples/type_types:Actress.json | 16 + .../examples/type_types:CastMember.json | 60 + .../examples/type_types:Directory.json | 63 + .../examples/type_types:Entity.json | 42 + .../examples/type_types:Exception.json | 50 + .../examples/type_types:ExceptionInfo.json | 20 + .../examples/type_types:ExtendedMovie.json | 15 + .../examples/type_types:File.json | 16 + .../examples/type_types:Metadata.json | 44 + .../examples/type_types:Migration.json | 25 + .../examples/type_types:MigrationStatus.json | 9 + .../examples/type_types:Moment.json | 23 + .../examples/type_types:Movie.json | 66 + .../examples/type_types:MovieId.json | 4 + .../examples/type_types:Node.json | 59 + .../examples/type_types:Request.json | 19 + .../examples/type_types:Response.json | 71 + .../examples/type_types:ResponseType.json | 38 + .../examples/type_types:StuntDouble.json | 16 + .../examples/type_types:Test.json | 44 + .../examples/type_types:Tree.json | 47 + ...e_general-errors:BadObjectRequestInfo.json | 12 + .../type_types/enum:WeatherReport.json | 10 + .../type_types/object:DoubleOptional.json | 13 + .../object:NestedObjectWithOptionalField.json | 72 + .../object:NestedObjectWithRequiredField.json | 76 + .../type_types/object:ObjectWithMapOfMap.json | 18 + .../object:ObjectWithOptionalField.json | 60 + .../object:ObjectWithRequiredField.json | 12 + .../type_types/object:OptionalAlias.json | 4 + .../exhaustive/type_types/union:Animal.json | 54 + .../exhaustive/type_types/union:Cat.json | 16 + .../exhaustive/type_types/union:Dog.json | 16 + .../__snapshots__/extends/type_:Docs.json | 12 + .../extends/type_:ExampleType.json | 12 + .../__snapshots__/extends/type_:JSON.json | 12 + .../extends/type_:NestedType.json | 12 + .../extra-properties/type_:Failure.json | 15 + .../extra-properties/type_user:User.json | 12 + .../file-upload/type_service:Id.json | 4 + .../file-upload/type_service:MyObject.json | 12 + .../file-upload/type_service:ObjectType.json | 8 + .../folders/type_a/d/types:Foo.json | 4 + .../type_imdb:CreateMovieRequest.json | 16 + .../grpc-proto-exhaustive/type_:Column.json | 84 + .../type_:DeleteResponse.json | 5 + .../type_:DescribeResponse.json | 33 + .../type_:FetchResponse.json | 110 ++ .../type_:IndexedData.json | 23 + .../type_:ListElement.json | 9 + .../type_:ListResponse.json | 47 + .../grpc-proto-exhaustive/type_:Metadata.json | 38 + .../type_:MetadataValue.json | 14 + .../type_:NamespaceSummary.json | 10 + .../type_:Pagination.json | 9 + .../type_:QueryColumn.json | 87 + .../type_:QueryResponse.json | 132 ++ .../type_:QueryResult.json | 100 ++ .../type_:ScoredColumn.json | 86 + .../type_:UpdateResponse.json | 5 + .../type_:UploadResponse.json | 10 + .../grpc-proto-exhaustive/type_:Usage.json | 10 + .../grpc-proto/type_:CreateResponse.json | 67 + .../grpc-proto/type_:Metadata.json | 38 + .../grpc-proto/type_:MetadataValue.json | 14 + .../grpc-proto/type_:UserModel.json | 59 + .../type_payment:Currency.json | 8 + .../imdb/type_imdb:CreateMovieRequest.json | 16 + .../__snapshots__/imdb/type_imdb:Movie.json | 24 + .../__snapshots__/imdb/type_imdb:MovieId.json | 4 + .../literal/type_:SendResponse.json | 23 + .../literal/type_inlined:ANestedLiteral.json | 15 + .../type_inlined:ATopLevelLiteral.json | 27 + .../type_inlined:SomeAliasedLiteral.json | 7 + .../type_reference:ContainerObject.json | 41 + ...pe_reference:NestedObjectWithLiterals.json | 26 + .../literal/type_reference:SendRequest.json | 83 + .../literal/type_reference:SomeLiteral.json | 7 + .../mixed-case/type_service:NestedUser.json | 42 + .../mixed-case/type_service:Organization.json | 12 + .../mixed-case/type_service:Resource.json | 60 + .../type_service:ResourceStatus.json | 8 + .../mixed-case/type_service:User.json | 26 + .../mixed-file-directory/type_:Id.json | 4 + ...rganization:CreateOrganizationRequest.json | 12 + .../type_organization:Organization.json | 46 + .../type_user/events/metadata:Metadata.json | 27 + .../type_user/events:Event.json | 20 + .../mixed-file-directory/type_user:User.json | 24 + .../multi-line-docs/type_:Operand.json | 9 + .../multi-line-docs/type_user:User.json | 19 + .../type_auth:TokenResponse.json | 16 + .../type_auth:TokenResponse.json | 19 + .../type_auth:TokenResponse.json | 19 + .../type_auth:TokenResponse.json | 19 + .../__snapshots__/object/type_:Name.json | 16 + .../__snapshots__/object/type_:Type.json | 158 ++ .../objects-with-imports/type_:Node.json | 36 + .../objects-with-imports/type_:Tree.json | 47 + .../type_commons/metadata:Metadata.json | 18 + .../type_file/directory:Directory.json | 74 + .../objects-with-imports/type_file:File.json | 28 + .../type_file:FileInfo.json | 8 + .../package-yml/type_:EchoRequest.json | 16 + .../pagination/type_:UsernameCursor.json | 30 + .../pagination/type_:UsernamePage.json | 18 + ...ListUsersExtendedOptionalListResponse.json | 12 + .../type_users:ListUsersExtendedResponse.json | 12 + ...ype_users:ListUsersPaginationResponse.json | 78 + .../pagination/type_users:NextPage.json | 16 + .../pagination/type_users:Order.json | 8 + .../pagination/type_users:Page.json | 39 + .../pagination/type_users:User.json | 16 + .../type_users:UserListContainer.json | 31 + .../type_users:UserOptionalListContainer.json | 28 + .../type_users:UserOptionalListPage.json | 43 + .../pagination/type_users:UserPage.json | 46 + .../type_users:UsernameContainer.json | 15 + .../pagination/type_users:WithCursor.json | 9 + .../pagination/type_users:WithPage.json | 9 + .../type_user:NestedUser.json | 35 + .../query-parameters/type_user:User.json | 19 + .../type_package:Package.json | 12 + .../type_package:Record.json | 19 + .../type_:OptionalStringResponse.json | 16 + .../type_:StringResponse.json | 12 + .../response-property/type_:WithMetadata.json | 15 + .../response-property/type_service:Movie.json | 16 + .../type_service:OptionalWithDocs.json | 16 + .../type_service:Response.json | 28 + .../type_service:WithDocs.json | 12 + .../type_completions:StreamedCompletion.json | 15 + .../type_completions:StreamedCompletion.json | 15 + .../simple-fhir/type_:Account.json | 87 + .../simple-fhir/type_:BaseResource.json | 139 ++ .../__snapshots__/simple-fhir/type_:Memo.json | 101 ++ .../simple-fhir/type_:Patient.json | 45 + .../simple-fhir/type_:Practitioner.json | 19 + .../simple-fhir/type_:ResourceList.json | 103 ++ .../simple-fhir/type_:Script.json | 19 + .../type_dummy:RegularResponse.json | 15 + .../type_dummy:StreamResponse.json | 15 + .../streaming/type_dummy:StreamResponse.json | 15 + .../__snapshots__/trace/type_admin:Test.json | 44 + ...pe_commons:BinaryTreeNodeAndTreeValue.json | 58 + .../type_commons:BinaryTreeNodeValue.json | 26 + .../trace/type_commons:BinaryTreeValue.json | 43 + .../type_commons:DebugKeyValuePairs.json | 363 ++++ .../trace/type_commons:DebugMapValue.json | 362 ++++ .../type_commons:DebugVariableValue.json | 565 ++++++ ...mons:DoublyLinkedListNodeAndListValue.json | 58 + ...ype_commons:DoublyLinkedListNodeValue.json | 26 + .../type_commons:DoublyLinkedListValue.json | 43 + .../trace/type_commons:FileInfo.json | 16 + .../trace/type_commons:GenericValue.json | 15 + .../trace/type_commons:KeyValuePair.json | 289 +++ .../trace/type_commons:Language.json | 9 + .../trace/type_commons:ListType.json | 156 ++ .../trace/type_commons:MapType.json | 157 ++ .../trace/type_commons:MapValue.json | 288 +++ .../trace/type_commons:NodeId.json | 4 + .../trace/type_commons:ProblemId.json | 4 + ...mons:SinglyLinkedListNodeAndListValue.json | 55 + ...ype_commons:SinglyLinkedListNodeValue.json | 23 + .../type_commons:SinglyLinkedListValue.json | 40 + .../trace/type_commons:TestCase.json | 292 +++ ...pe_commons:TestCaseWithExpectedResult.json | 307 ++++ .../trace/type_commons:UserId.json | 4 + .../trace/type_commons:VariableType.json | 282 +++ .../trace/type_commons:VariableValue.json | 468 +++++ .../type_lang-server:LangServerRequest.json | 19 + .../type_lang-server:LangServerResponse.json | 19 + .../trace/type_migration:Migration.json | 25 + .../trace/type_migration:MigrationStatus.json | 9 + .../trace/type_playlist:Playlist.json | 23 + .../type_playlist:PlaylistCreateRequest.json | 23 + .../trace/type_playlist:PlaylistId.json | 4 + ..._playlist:PlaylistIdNotFoundErrorBody.json | 34 + .../type_playlist:ReservedKeywordEnum.json | 8 + .../type_playlist:UpdatePlaylistRequest.json | 23 + .../type_problem:CreateProblemError.json | 39 + .../type_problem:CreateProblemRequest.json | 610 +++++++ .../type_problem:CreateProblemResponse.json | 86 + ...ype_problem:GenericCreateProblemError.json | 20 + ...roblem:GetDefaultStarterFilesResponse.json | 49 + .../type_problem:ProblemDescription.json | 345 ++++ .../type_problem:ProblemDescriptionBoard.json | 331 ++++ .../trace/type_problem:ProblemFiles.json | 35 + .../trace/type_problem:ProblemInfo.json | 625 +++++++ .../type_problem:UpdateProblemResponse.json | 12 + .../type_problem:VariableTypeAndName.json | 157 ++ .../trace/type_submission:ActualResult.json | 389 ++++ ...e_submission:BuildingExecutorResponse.json | 32 + .../type_submission:CodeExecutionUpdate.json | 1086 +++++++++++ .../trace/type_submission:CompileError.json | 12 + ...submission:CustomTestCasesUnsupported.json | 24 + .../trace/type_submission:ErrorInfo.json | 81 + .../type_submission:ErroredResponse.json | 100 ++ .../trace/type_submission:ExceptionInfo.json | 20 + .../trace/type_submission:ExceptionV2.json | 50 + ...e_submission:ExecutionSessionResponse.json | 43 + ...type_submission:ExecutionSessionState.json | 50 + ...ype_submission:ExecutionSessionStatus.json | 12 + ...ubmission:ExistingSubmissionExecuting.json | 17 + .../type_submission:ExpressionLocation.json | 16 + .../type_submission:FinishedResponse.json | 17 + ...sion:GetExecutionSessionStateResponse.json | 74 + ...submission:GetSubmissionStateResponse.json | 916 ++++++++++ ...bmission:GetTraceResponsesPageRequest.json | 9 + .../trace/type_submission:GradedResponse.json | 445 +++++ .../type_submission:GradedResponseV2.json | 400 +++++ .../type_submission:GradedTestCaseUpdate.json | 396 ++++ ...e_submission:InitializeProblemRequest.json | 19 + .../trace/type_submission:InternalError.json | 32 + .../type_submission:InvalidRequestCause.json | 85 + ...ype_submission:InvalidRequestResponse.json | 243 +++ ...sion:LightweightStackframeInformation.json | 16 + ...bmission:RecordedResponseNotification.json | 24 + ...ype_submission:RecordedTestCaseUpdate.json | 20 + ...mission:RecordingResponseNotification.json | 61 + .../type_submission:RunningResponse.json | 31 + ...ype_submission:RunningSubmissionState.json | 11 + .../trace/type_submission:RuntimeError.json | 12 + .../trace/type_submission:Scope.json | 362 ++++ .../trace/type_submission:ShareId.json | 4 + .../trace/type_submission:StackFrame.json | 384 ++++ .../type_submission:StackInformation.json | 398 ++++ .../trace/type_submission:StderrResponse.json | 21 + .../trace/type_submission:StdoutResponse.json | 21 + .../trace/type_submission:StopRequest.json | 17 + .../type_submission:StoppedResponse.json | 17 + .../type_submission:SubmissionFileInfo.json | 20 + .../trace/type_submission:SubmissionId.json | 5 + .../type_submission:SubmissionIdNotFound.json | 17 + .../type_submission:SubmissionRequest.json | 160 ++ .../type_submission:SubmissionResponse.json | 1185 ++++++++++++ ...ubmission:SubmissionStatusForTestCase.json | 545 ++++++ .../type_submission:SubmissionStatusV2.json | 1594 +++++++++++++++++ .../type_submission:SubmissionTypeEnum.json | 7 + .../type_submission:SubmissionTypeState.json | 885 +++++++++ .../type_submission:SubmitRequestV2.json | 68 + .../type_submission:TerminatedResponse.json | 5 + .../trace/type_submission:TestCaseGrade.json | 378 ++++ .../type_submission:TestCaseHiddenGrade.json | 12 + ...ype_submission:TestCaseNonHiddenGrade.json | 344 ++++ .../trace/type_submission:TestCaseResult.json | 408 +++++ ...e_submission:TestCaseResultWithStdout.json | 423 +++++ .../type_submission:TestSubmissionState.json | 755 ++++++++ .../type_submission:TestSubmissionStatus.json | 705 ++++++++ ...ype_submission:TestSubmissionStatusV2.json | 1429 +++++++++++++++ .../type_submission:TestSubmissionUpdate.json | 589 ++++++ ...e_submission:TestSubmissionUpdateInfo.json | 573 ++++++ .../trace/type_submission:TraceResponse.json | 445 +++++ .../type_submission:TraceResponseV2.json | 464 +++++ .../type_submission:TraceResponsesPage.json | 462 +++++ .../type_submission:TraceResponsesPageV2.json | 481 +++++ .../trace/type_submission:TracedFile.json | 16 + .../trace/type_submission:TracedTestCase.json | 438 +++++ ...pe_submission:UnexpectedLanguageError.json | 25 + .../trace/type_submission:WorkspaceFiles.json | 35 + .../type_submission:WorkspaceRanResponse.json | 106 ++ .../type_submission:WorkspaceRunDetails.json | 87 + ...mission:WorkspaceStarterFilesResponse.json | 49 + ...ssion:WorkspaceStarterFilesResponseV2.json | 53 + ...e_submission:WorkspaceSubmissionState.json | 247 +++ ..._submission:WorkspaceSubmissionStatus.json | 236 +++ ...ubmission:WorkspaceSubmissionStatusV2.json | 282 +++ ..._submission:WorkspaceSubmissionUpdate.json | 268 +++ ...mission:WorkspaceSubmissionUpdateInfo.json | 252 +++ ...ype_submission:WorkspaceSubmitRequest.json | 58 + ...type_submission:WorkspaceTracedUpdate.json | 12 + .../problem:AssertCorrectnessCheck.json | 244 +++ .../type_v2/problem:BasicCustomFiles.json | 328 ++++ .../problem:BasicTestCaseTemplate.json | 88 + .../problem:CreateProblemRequestV2.json | 1048 +++++++++++ .../trace/type_v2/problem:CustomFiles.json | 364 ++++ .../problem:DeepEqualityCorrectnessCheck.json | 16 + .../type_v2/problem:DefaultProvidedFile.json | 183 ++ .../trace/type_v2/problem:FileInfoV2.json | 24 + .../trace/type_v2/problem:Files.json | 39 + .../problem:FunctionImplementation.json | 15 + ...ionImplementationForMultipleLanguages.json | 30 + .../type_v2/problem:FunctionSignature.json | 241 +++ .../trace/type_v2/problem:GeneratedFiles.json | 67 + .../problem:GetBasicSolutionFileRequest.json | 197 ++ .../problem:GetBasicSolutionFileResponse.json | 39 + .../problem:GetFunctionSignatureRequest.json | 252 +++ .../problem:GetFunctionSignatureResponse.json | 15 + ...oblem:GetGeneratedTestCaseFileRequest.json | 816 +++++++++ ...tGeneratedTestCaseTemplateFileRequest.json | 438 +++++ .../problem:LightweightProblemInfoV2.json | 172 ++ .../problem:NonVoidFunctionDefinition.json | 225 +++ .../problem:NonVoidFunctionSignature.json | 182 ++ .../trace/type_v2/problem:Parameter.json | 164 ++ .../trace/type_v2/problem:ParameterId.json | 4 + .../trace/type_v2/problem:ProblemInfoV2.json | 1091 +++++++++++ .../type_v2/problem:TestCaseExpects.json | 9 + .../type_v2/problem:TestCaseFunction.json | 333 ++++ .../trace/type_v2/problem:TestCaseId.json | 4 + .../problem:TestCaseImplementation.json | 405 +++++ ...lem:TestCaseImplementationDescription.json | 62 + ...estCaseImplementationDescriptionBoard.json | 48 + ...oblem:TestCaseImplementationReference.json | 441 +++++ .../type_v2/problem:TestCaseMetadata.json | 24 + .../type_v2/problem:TestCaseTemplate.json | 427 +++++ .../type_v2/problem:TestCaseTemplateId.json | 4 + .../trace/type_v2/problem:TestCaseV2.json | 768 ++++++++ ...estCaseWithActualResultImplementation.json | 292 +++ .../problem:VoidFunctionDefinition.json | 210 +++ ...nctionDefinitionThatTakesActualResult.json | 210 +++ .../problem:VoidFunctionSignature.json | 178 ++ ...unctionSignatureThatTakesActualResult.json | 182 ++ .../v3/problem:AssertCorrectnessCheck.json | 244 +++ .../type_v2/v3/problem:BasicCustomFiles.json | 328 ++++ .../v3/problem:BasicTestCaseTemplate.json | 88 + .../v3/problem:CreateProblemRequestV2.json | 1048 +++++++++++ .../trace/type_v2/v3/problem:CustomFiles.json | 364 ++++ .../problem:DeepEqualityCorrectnessCheck.json | 16 + .../v3/problem:DefaultProvidedFile.json | 183 ++ .../trace/type_v2/v3/problem:FileInfoV2.json | 24 + .../trace/type_v2/v3/problem:Files.json | 39 + .../v3/problem:FunctionImplementation.json | 15 + ...ionImplementationForMultipleLanguages.json | 30 + .../type_v2/v3/problem:FunctionSignature.json | 241 +++ .../type_v2/v3/problem:GeneratedFiles.json | 67 + .../problem:GetBasicSolutionFileRequest.json | 197 ++ .../problem:GetBasicSolutionFileResponse.json | 39 + .../problem:GetFunctionSignatureRequest.json | 252 +++ .../problem:GetFunctionSignatureResponse.json | 15 + ...oblem:GetGeneratedTestCaseFileRequest.json | 816 +++++++++ ...tGeneratedTestCaseTemplateFileRequest.json | 438 +++++ .../v3/problem:LightweightProblemInfoV2.json | 172 ++ .../v3/problem:NonVoidFunctionDefinition.json | 225 +++ .../v3/problem:NonVoidFunctionSignature.json | 182 ++ .../trace/type_v2/v3/problem:Parameter.json | 164 ++ .../trace/type_v2/v3/problem:ParameterId.json | 4 + .../type_v2/v3/problem:ProblemInfoV2.json | 1091 +++++++++++ .../type_v2/v3/problem:TestCaseExpects.json | 9 + .../type_v2/v3/problem:TestCaseFunction.json | 333 ++++ .../trace/type_v2/v3/problem:TestCaseId.json | 4 + .../v3/problem:TestCaseImplementation.json | 405 +++++ ...lem:TestCaseImplementationDescription.json | 62 + ...estCaseImplementationDescriptionBoard.json | 48 + ...oblem:TestCaseImplementationReference.json | 441 +++++ .../type_v2/v3/problem:TestCaseMetadata.json | 24 + .../type_v2/v3/problem:TestCaseTemplate.json | 427 +++++ .../v3/problem:TestCaseTemplateId.json | 4 + .../trace/type_v2/v3/problem:TestCaseV2.json | 768 ++++++++ ...estCaseWithActualResultImplementation.json | 292 +++ .../v3/problem:VoidFunctionDefinition.json | 210 +++ ...nctionDefinitionThatTakesActualResult.json | 210 +++ .../v3/problem:VoidFunctionSignature.json | 178 ++ ...unctionSignatureThatTakesActualResult.json | 182 ++ .../ts-express-casing/type_imdb:Movie.json | 24 + .../ts-express-casing/type_imdb:MovieId.json | 4 + .../type_union:Key.json | 22 + .../type_union:KeyType.json | 8 + .../type_union:Metadata.json | 7 + .../type_union:MyUnion.json | 39 + .../type_union:TypeWithOptionalUnion.json | 48 + .../__snapshots__/unions/type_types:Bar.json | 12 + .../__snapshots__/unions/type_types:Foo.json | 12 + .../unions/type_types:Union.json | 67 + .../type_types:UnionWithBaseProperties.json | 59 + .../type_types:UnionWithDiscriminant.json | 67 + .../unions/type_types:UnionWithLiteral.json | 33 + .../type_types:UnionWithOptionalTime.json | 46 + .../unions/type_types:UnionWithPrimitive.json | 44 + .../type_types:UnionWithSingleElement.json | 31 + .../unions/type_types:UnionWithTime.json | 60 + .../unions/type_types:UnionWithUnknown.json | 42 + .../unions/type_types:UnionWithoutKey.json | 46 + .../unions/type_union:Circle.json | 12 + .../unions/type_union:GetShapeRequest.json | 12 + .../unions/type_union:Shape.json | 46 + .../unions/type_union:Square.json | 12 + .../unknown/type_unknown:MyAlias.json | 11 + .../unknown/type_unknown:MyObject.json | 19 + .../validation/type_:Double.json | 4 + .../validation/type_:LargeInteger.json | 4 + .../validation/type_:Sentence.json | 4 + .../__snapshots__/validation/type_:Shape.json | 9 + .../validation/type_:SmallInteger.json | 4 + .../__snapshots__/validation/type_:Type.json | 33 + .../__snapshots__/validation/type_:Word.json | 4 + .../version-no-default/type_user:User.json | 20 + .../version-no-default/type_user:UserId.json | 4 + .../__snapshots__/version/type_user:User.json | 20 + .../version/type_user:UserId.json | 4 + .../__test__/convertIRtoJsonSchema.test.ts | 58 + .../src/convertIRtoJsonSchema.ts | 27 + .../src/converters/containerToJsonSchema.ts | 40 + .../convertTypeDeclarationToJsonSchema.ts | 36 + .../src/converters/enumToJsonSchema.ts | 17 + .../src/converters/objectToJsonSchema.ts | 32 + .../converters/typeReferenceToJsonSchema.ts | 125 ++ .../undiscriminatedUnionToJsonSchema.ts | 29 + .../src/converters/unionToJsonSchema.ts | 61 + .../ir-to-jsonschema/src/index.ts | 1 + .../ir-to-jsonschema/tsconfig.json | 14 + .../ir-to-jsonschema/vitest.config.ts | 1 + .../cli/fern-definition/schema/package.json | 2 +- .../fern-definition/validator/package.json | 2 +- .../cli/generation/ir-generator/package.json | 2 +- .../cli/generation/ir-generator/src/index.ts | 2 + .../cli/generation/ir-migrations/package.json | 2 +- .../docker-utils/package.json | 2 +- .../local-workspace-runner/package.json | 2 +- .../remote-workspace-runner/package.json | 2 +- packages/cli/init/package.json | 2 +- packages/cli/lazy-fern-workspace/package.json | 2 +- packages/cli/logger/package.json | 2 +- packages/cli/login/package.json | 2 +- packages/cli/mock/package.json | 2 +- packages/cli/posthog-manager/package.json | 2 +- packages/cli/project-loader/package.json | 2 +- packages/cli/register/package.json | 4 +- packages/cli/semver-utils/package.json | 2 +- packages/cli/task-context/package.json | 2 +- packages/cli/workspace-commons/package.json | 2 +- packages/cli/workspace-loader/package.json | 2 +- packages/cli/yaml/docs-validator/package.json | 2 +- packages/commons/core-utils/package.json | 2 +- packages/commons/fs-utils/package.json | 2 +- packages/commons/loadable/package.json | 2 +- packages/commons/logging-execa/package.json | 2 +- packages/core/package.json | 4 +- packages/ir-sdk/package.json | 2 +- packages/scripts/package.json | 2 +- packages/seed/package.json | 2 +- pnpm-lock.yaml | 274 +-- pnpm-workspace.yaml | 4 +- 619 files changed, 54452 insertions(+), 254 deletions(-) rename generators/{pythonv2 => python-v2}/codegen/.depcheckrc.json (100%) rename generators/{pythonv2 => python-v2}/codegen/.prettierrc.cjs (100%) rename generators/{pythonv2 => python-v2}/codegen/package.json (93%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Class.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/CodeBlock.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Decorator.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Field.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Method.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/MethodArgument.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/MethodInvocation.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Parameter.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/PythonFile.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Reference.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/Type.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Class.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/CodeBlock.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Decorator.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Field.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Method.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/MethodInvocation.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/PythonFile.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Reference.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/Type.test.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Class.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/CodeBlock.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Decorator.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Field.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Method.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/MethodInvocation.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/PythonFile.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Reference.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/__test__/__snapshots__/Type.test.ts.snap (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/core/AstNode.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/core/Writer.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/ast/index.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/index.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/src/python.ts (100%) rename generators/{pythonv2 => python-v2}/codegen/tsconfig.json (100%) rename generators/{pythonv2 => python-v2}/codegen/vitest.config.ts (100%) create mode 100644 packages/cli/cli/src/commands/jsonschema/generateJsonschemaForWorkspace.ts create mode 100644 packages/cli/ete-tests/src/tests/jsonschema/__snapshots__/jsonschema.test.ts.snap create mode 100644 packages/cli/ete-tests/src/tests/jsonschema/jsonschema.test.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/.depcheckrc.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/.prettierrc.cjs create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/package.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/JsonSchemaConverterContext.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:AliasType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Child.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Parent.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Object.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Type.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:TypeId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_auth:TokenResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_commons:Imported.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-a/service:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-b/common:Foo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-c/common:FolderCFoo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-d/service:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:FilteredType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:ImportingType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:OptionalString.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth-environment-variables/type_errors:UnauthorizedRequestErrorBody.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth/type_errors:UnauthorizedRequestErrorBody.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:ImportingA.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:RootType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_a:A.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ContainerValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldName.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectFieldValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:PrimitiveValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:ImportingA.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:RootType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_a:A.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ContainerValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:FieldValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:JsonLike.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ObjectValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:PrimitiveValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_commons:Imported.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-a/service:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-b/common:Foo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-c/common:Foo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-d/service:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:ImportingType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:OptionalString.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:A.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:B.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:SubTestType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_b:TestType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_tasktest:Task.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/custom-auth/type_errors:UnauthorizedRequestErrorBody.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Color.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:ColorOrOperand.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Operand.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/error-property/type_errors:PropertyBasedErrorTestBody.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:BasicType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:ComplexType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Identifier.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Type.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Data.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:EventInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Tag.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_file/service:Filename.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actor.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actress.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:CastMember.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Directory.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Entity.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Exception.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExceptionInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExtendedMovie.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:File.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Migration.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MigrationStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Moment.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Movie.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MovieId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Node.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Request.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ResponseType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:StuntDouble.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Test.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Tree.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_general-errors:BadObjectRequestInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/enum:WeatherReport.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:DoubleOptional.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithOptionalField.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithRequiredField.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithMapOfMap.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithOptionalField.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithRequiredField.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:OptionalAlias.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Animal.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Cat.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Dog.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:Docs.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:ExampleType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:JSON.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:NestedType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_:Failure.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:Id.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:MyObject.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:ObjectType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/folders/type_a/d/types:Foo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/go-content-type/type_imdb:CreateMovieRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Column.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DeleteResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DescribeResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:FetchResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:IndexedData.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListElement.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:MetadataValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:NamespaceSummary.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Pagination.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryColumn.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ScoredColumn.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UpdateResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UploadResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Usage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:CreateResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:MetadataValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:UserModel.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/idempotency-headers/type_payment:Currency.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:CreateMovieRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:Movie.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:MovieId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_:SendResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ANestedLiteral.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ATopLevelLiteral.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:SomeAliasedLiteral.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:ContainerObject.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:NestedObjectWithLiterals.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SendRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SomeLiteral.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:NestedUser.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Organization.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Resource.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:ResourceStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_:Id.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:CreateOrganizationRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:Organization.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events/metadata:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events:Event.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_:Operand.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-default/type_auth:TokenResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-environment-variables/type_auth:TokenResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-nested-root/type_auth:TokenResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials/type_auth:TokenResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Name.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Type.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Node.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Tree.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_commons/metadata:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file/directory:Directory.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:File.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:FileInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/package-yml/type_:EchoRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernameCursor.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernamePage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedOptionalListResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersPaginationResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:NextPage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Order.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Page.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserListContainer.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListContainer.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListPage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserPage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UsernameContainer.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithCursor.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithPage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:NestedUser.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Package.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Record.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:OptionalStringResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:StringResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:WithMetadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Movie.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:OptionalWithDocs.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Response.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:WithDocs.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-event-examples/type_completions:StreamedCompletion.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events/type_completions:StreamedCompletion.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Account.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:BaseResource.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Memo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Patient.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Practitioner.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:ResourceList.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Script.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:RegularResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:StreamResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming/type_dummy:StreamResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_admin:Test.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeAndTreeValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugKeyValuePairs.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugMapValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugVariableValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeAndListValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:FileInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:GenericValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:KeyValuePair.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:Language.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ListType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:NodeId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ProblemId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeAndListValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCase.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCaseWithExpectedResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:UserId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableValue.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:Migration.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:MigrationStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:Playlist.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistCreateRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistIdNotFoundErrorBody.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:ReservedKeywordEnum.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:UpdatePlaylistRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GenericCreateProblemError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GetDefaultStarterFilesResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescription.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescriptionBoard.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:UpdateProblemResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:VariableTypeAndName.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ActualResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:BuildingExecutorResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CodeExecutionUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CompileError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CustomTestCasesUnsupported.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErrorInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErroredResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionState.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExistingSubmissionExecuting.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExpressionLocation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:FinishedResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetExecutionSessionStateResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetSubmissionStateResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetTraceResponsesPageRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponseV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedTestCaseUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InitializeProblemRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InternalError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestCause.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:LightweightStackframeInformation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedResponseNotification.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedTestCaseUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordingResponseNotification.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningSubmissionState.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RuntimeError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:Scope.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ShareId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackFrame.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackInformation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StderrResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StdoutResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StopRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StoppedResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionFileInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionIdNotFound.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusForTestCase.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeEnum.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeState.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmitRequestV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TerminatedResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseGrade.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseHiddenGrade.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseNonHiddenGrade.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResultWithStdout.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionState.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatusV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdateInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponseV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPage.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPageV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedFile.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedTestCase.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:UnexpectedLanguageError.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRanResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRunDetails.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponseV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionState.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatus.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatusV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdateInfo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmitRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceTracedUpdate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:AssertCorrectnessCheck.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicCustomFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicTestCaseTemplate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CreateProblemRequestV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CustomFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DeepEqualityCorrectnessCheck.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DefaultProvidedFile.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FileInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Files.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementationForMultipleLanguages.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GeneratedFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseTemplateFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:LightweightProblemInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionDefinition.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Parameter.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ParameterId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ProblemInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseExpects.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseFunction.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescription.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescriptionBoard.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationReference.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseMetadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplateId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseWithActualResultImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinition.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinitionThatTakesActualResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignatureThatTakesActualResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:AssertCorrectnessCheck.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicCustomFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicTestCaseTemplate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CreateProblemRequestV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CustomFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DeepEqualityCorrectnessCheck.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DefaultProvidedFile.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FileInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Files.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementationForMultipleLanguages.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GeneratedFiles.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureResponse.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseTemplateFileRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:LightweightProblemInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionDefinition.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Parameter.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ParameterId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ProblemInfoV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseExpects.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseFunction.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescription.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescriptionBoard.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationReference.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseMetadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplate.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplateId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseV2.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseWithActualResultImplementation.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinition.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinitionThatTakesActualResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignature.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignatureThatTakesActualResult.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:Movie.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:MovieId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Key.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:KeyType.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Metadata.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:MyUnion.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:TypeWithOptionalUnion.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Bar.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Foo.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Union.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithBaseProperties.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithDiscriminant.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithLiteral.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithOptionalTime.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithPrimitive.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithSingleElement.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithTime.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithUnknown.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithoutKey.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Circle.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:GetShapeRequest.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Shape.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Square.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyAlias.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyObject.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Double.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:LargeInteger.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Sentence.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Shape.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:SmallInteger.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Type.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Word.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:UserId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:User.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:UserId.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/__test__/convertIRtoJsonSchema.test.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/convertIRtoJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/containerToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/convertTypeDeclarationToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/enumToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/objectToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/typeReferenceToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/undiscriminatedUnionToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/converters/unionToJsonSchema.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/src/index.ts create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/tsconfig.json create mode 100644 packages/cli/fern-definition/ir-to-jsonschema/vitest.config.ts diff --git a/generators/commons/package.json b/generators/commons/package.json index 4bc499a8f5e..ed4643f2b5d 100644 --- a/generators/commons/package.json +++ b/generators/commons/package.json @@ -41,7 +41,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/generators/csharp/codegen/package.json b/generators/csharp/codegen/package.json index 8ba45290f64..d450e3b8dad 100644 --- a/generators/csharp/codegen/package.json +++ b/generators/csharp/codegen/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/generators/csharp/model/package.json b/generators/csharp/model/package.json index e978133ba6f..129e3bcf20c 100644 --- a/generators/csharp/model/package.json +++ b/generators/csharp/model/package.json @@ -37,7 +37,7 @@ "@fern-fern/ir-sdk": "^53.7.0", "zod": "^3.22.3", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/csharp/sdk/package.json b/generators/csharp/sdk/package.json index f4051e8581c..e0ddc389681 100644 --- a/generators/csharp/sdk/package.json +++ b/generators/csharp/sdk/package.json @@ -44,7 +44,7 @@ "zod": "^3.22.3", "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/openapi/package.json b/generators/openapi/package.json index 3672736afa4..c545c57a3b3 100644 --- a/generators/openapi/package.json +++ b/generators/openapi/package.json @@ -43,7 +43,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/php/codegen/package.json b/generators/php/codegen/package.json index e7d79827de9..bd92a038ce8 100644 --- a/generators/php/codegen/package.json +++ b/generators/php/codegen/package.json @@ -43,7 +43,7 @@ "@fern-fern/ir-sdk": "^53.7.0", "zod": "^3.22.3", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/generators/php/model/package.json b/generators/php/model/package.json index 660b9f1975a..b0733e5a413 100644 --- a/generators/php/model/package.json +++ b/generators/php/model/package.json @@ -36,7 +36,7 @@ "@fern-api/php-codegen": "workspace:*", "@fern-fern/ir-sdk": "^53.7.0", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/php/sdk/package.json b/generators/php/sdk/package.json index 15d585e9daa..95356170b71 100644 --- a/generators/php/sdk/package.json +++ b/generators/php/sdk/package.json @@ -41,7 +41,7 @@ "@fern-fern/ir-sdk": "^53.7.0", "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/postman/package.json b/generators/postman/package.json index ef470c2dda0..a978b8e7cad 100644 --- a/generators/postman/package.json +++ b/generators/postman/package.json @@ -39,7 +39,7 @@ "@fern-fern/postman-sdk": "0.1.1", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.4", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "endent": "^2.1.0", diff --git a/generators/pythonv2/codegen/.depcheckrc.json b/generators/python-v2/codegen/.depcheckrc.json similarity index 100% rename from generators/pythonv2/codegen/.depcheckrc.json rename to generators/python-v2/codegen/.depcheckrc.json diff --git a/generators/pythonv2/codegen/.prettierrc.cjs b/generators/python-v2/codegen/.prettierrc.cjs similarity index 100% rename from generators/pythonv2/codegen/.prettierrc.cjs rename to generators/python-v2/codegen/.prettierrc.cjs diff --git a/generators/pythonv2/codegen/package.json b/generators/python-v2/codegen/package.json similarity index 93% rename from generators/pythonv2/codegen/package.json rename to generators/python-v2/codegen/package.json index 1b89c94f933..0d365ff1fd0 100644 --- a/generators/pythonv2/codegen/package.json +++ b/generators/python-v2/codegen/package.json @@ -29,12 +29,11 @@ "dependencies": { "@fern-api/core-utils": "workspace:*", "@fern-api/generator-commons": "workspace:*", - "@fern-fern/ir-sdk": "^53.7.0", + "@fern-fern/ir-sdk": "53.7.0", "@wasm-fmt/ruff_fmt": "^0.6.1" }, "devDependencies": { - "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/generators/pythonv2/codegen/src/ast/Class.ts b/generators/python-v2/codegen/src/ast/Class.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Class.ts rename to generators/python-v2/codegen/src/ast/Class.ts diff --git a/generators/pythonv2/codegen/src/ast/CodeBlock.ts b/generators/python-v2/codegen/src/ast/CodeBlock.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/CodeBlock.ts rename to generators/python-v2/codegen/src/ast/CodeBlock.ts diff --git a/generators/pythonv2/codegen/src/ast/Decorator.ts b/generators/python-v2/codegen/src/ast/Decorator.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Decorator.ts rename to generators/python-v2/codegen/src/ast/Decorator.ts diff --git a/generators/pythonv2/codegen/src/ast/Field.ts b/generators/python-v2/codegen/src/ast/Field.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Field.ts rename to generators/python-v2/codegen/src/ast/Field.ts diff --git a/generators/pythonv2/codegen/src/ast/Method.ts b/generators/python-v2/codegen/src/ast/Method.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Method.ts rename to generators/python-v2/codegen/src/ast/Method.ts diff --git a/generators/pythonv2/codegen/src/ast/MethodArgument.ts b/generators/python-v2/codegen/src/ast/MethodArgument.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/MethodArgument.ts rename to generators/python-v2/codegen/src/ast/MethodArgument.ts diff --git a/generators/pythonv2/codegen/src/ast/MethodInvocation.ts b/generators/python-v2/codegen/src/ast/MethodInvocation.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/MethodInvocation.ts rename to generators/python-v2/codegen/src/ast/MethodInvocation.ts diff --git a/generators/pythonv2/codegen/src/ast/Parameter.ts b/generators/python-v2/codegen/src/ast/Parameter.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Parameter.ts rename to generators/python-v2/codegen/src/ast/Parameter.ts diff --git a/generators/pythonv2/codegen/src/ast/PythonFile.ts b/generators/python-v2/codegen/src/ast/PythonFile.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/PythonFile.ts rename to generators/python-v2/codegen/src/ast/PythonFile.ts diff --git a/generators/pythonv2/codegen/src/ast/Reference.ts b/generators/python-v2/codegen/src/ast/Reference.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Reference.ts rename to generators/python-v2/codegen/src/ast/Reference.ts diff --git a/generators/pythonv2/codegen/src/ast/Type.ts b/generators/python-v2/codegen/src/ast/Type.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/Type.ts rename to generators/python-v2/codegen/src/ast/Type.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Class.test.ts b/generators/python-v2/codegen/src/ast/__test__/Class.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Class.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Class.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/CodeBlock.test.ts b/generators/python-v2/codegen/src/ast/__test__/CodeBlock.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/CodeBlock.test.ts rename to generators/python-v2/codegen/src/ast/__test__/CodeBlock.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Decorator.test.ts b/generators/python-v2/codegen/src/ast/__test__/Decorator.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Decorator.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Decorator.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Field.test.ts b/generators/python-v2/codegen/src/ast/__test__/Field.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Field.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Field.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Method.test.ts b/generators/python-v2/codegen/src/ast/__test__/Method.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Method.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Method.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/MethodInvocation.test.ts b/generators/python-v2/codegen/src/ast/__test__/MethodInvocation.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/MethodInvocation.test.ts rename to generators/python-v2/codegen/src/ast/__test__/MethodInvocation.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/PythonFile.test.ts b/generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/PythonFile.test.ts rename to generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Reference.test.ts b/generators/python-v2/codegen/src/ast/__test__/Reference.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Reference.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Reference.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/Type.test.ts b/generators/python-v2/codegen/src/ast/__test__/Type.test.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/Type.test.ts rename to generators/python-v2/codegen/src/ast/__test__/Type.test.ts diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Class.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Class.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Class.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Class.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/CodeBlock.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/CodeBlock.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/CodeBlock.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/CodeBlock.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Decorator.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Decorator.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Decorator.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Decorator.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Field.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Field.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Field.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Field.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Method.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Method.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Method.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Method.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/MethodInvocation.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/MethodInvocation.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/MethodInvocation.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/MethodInvocation.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/PythonFile.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/PythonFile.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/PythonFile.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/PythonFile.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Reference.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Reference.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Reference.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Reference.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Type.test.ts.snap b/generators/python-v2/codegen/src/ast/__test__/__snapshots__/Type.test.ts.snap similarity index 100% rename from generators/pythonv2/codegen/src/ast/__test__/__snapshots__/Type.test.ts.snap rename to generators/python-v2/codegen/src/ast/__test__/__snapshots__/Type.test.ts.snap diff --git a/generators/pythonv2/codegen/src/ast/core/AstNode.ts b/generators/python-v2/codegen/src/ast/core/AstNode.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/core/AstNode.ts rename to generators/python-v2/codegen/src/ast/core/AstNode.ts diff --git a/generators/pythonv2/codegen/src/ast/core/Writer.ts b/generators/python-v2/codegen/src/ast/core/Writer.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/core/Writer.ts rename to generators/python-v2/codegen/src/ast/core/Writer.ts diff --git a/generators/pythonv2/codegen/src/ast/index.ts b/generators/python-v2/codegen/src/ast/index.ts similarity index 100% rename from generators/pythonv2/codegen/src/ast/index.ts rename to generators/python-v2/codegen/src/ast/index.ts diff --git a/generators/pythonv2/codegen/src/index.ts b/generators/python-v2/codegen/src/index.ts similarity index 100% rename from generators/pythonv2/codegen/src/index.ts rename to generators/python-v2/codegen/src/index.ts diff --git a/generators/pythonv2/codegen/src/python.ts b/generators/python-v2/codegen/src/python.ts similarity index 100% rename from generators/pythonv2/codegen/src/python.ts rename to generators/python-v2/codegen/src/python.ts diff --git a/generators/pythonv2/codegen/tsconfig.json b/generators/python-v2/codegen/tsconfig.json similarity index 100% rename from generators/pythonv2/codegen/tsconfig.json rename to generators/python-v2/codegen/tsconfig.json diff --git a/generators/pythonv2/codegen/vitest.config.ts b/generators/python-v2/codegen/vitest.config.ts similarity index 100% rename from generators/pythonv2/codegen/vitest.config.ts rename to generators/python-v2/codegen/vitest.config.ts diff --git a/generators/ruby/cli/package.json b/generators/ruby/cli/package.json index 6256980373a..c5561929d28 100644 --- a/generators/ruby/cli/package.json +++ b/generators/ruby/cli/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/ruby/codegen/package.json b/generators/ruby/codegen/package.json index efa86d2661e..a6e623e04d9 100644 --- a/generators/ruby/codegen/package.json +++ b/generators/ruby/codegen/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/generators/ruby/model/package.json b/generators/ruby/model/package.json index 06c44b4daca..acf33cca7c2 100644 --- a/generators/ruby/model/package.json +++ b/generators/ruby/model/package.json @@ -40,7 +40,7 @@ "@fern-fern/generator-exec-sdk": "^0.0.898", "@fern-fern/ir-sdk": "^39", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/ruby/sdk/package.json b/generators/ruby/sdk/package.json index 9be9b8ab726..6838e0a92ae 100644 --- a/generators/ruby/sdk/package.json +++ b/generators/ruby/sdk/package.json @@ -42,7 +42,7 @@ "@fern-fern/generator-exec-sdk": "^0.0.898", "@fern-fern/ir-sdk": "^39", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/swift/codegen/package.json b/generators/swift/codegen/package.json index 1e41af9e015..48ebd66e77f 100644 --- a/generators/swift/codegen/package.json +++ b/generators/swift/codegen/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "depcheck": "^1.4.6", "esbuild": "^0.24.0", diff --git a/generators/typescript/codegen/package.json b/generators/typescript/codegen/package.json index 2c42b3124f7..f45fe2b133b 100644 --- a/generators/typescript/codegen/package.json +++ b/generators/typescript/codegen/package.json @@ -30,7 +30,7 @@ "@fern-api/generator-commons": "workspace:*", "@fern-fern/ir-sdk": "53.8.0", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/generators/typescript/express/cli/package.json b/generators/typescript/express/cli/package.json index 57b6f2fcbfe..d4babf5c34b 100644 --- a/generators/typescript/express/cli/package.json +++ b/generators/typescript/express/cli/package.json @@ -39,7 +39,7 @@ "@ts-morph/common": "^0.25.0", "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/tmp": "^0.2.4", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/generators/typescript/express/express-endpoint-type-schemas-generator/package.json b/generators/typescript/express/express-endpoint-type-schemas-generator/package.json index 9301d963ba2..7cd15186142 100644 --- a/generators/typescript/express/express-endpoint-type-schemas-generator/package.json +++ b/generators/typescript/express/express-endpoint-type-schemas-generator/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-error-generator/package.json b/generators/typescript/express/express-error-generator/package.json index 38c192e36b4..b4d974e75d5 100644 --- a/generators/typescript/express/express-error-generator/package.json +++ b/generators/typescript/express/express-error-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-error-schema-generator/package.json b/generators/typescript/express/express-error-schema-generator/package.json index 94560afabe3..0d0ea2a1e56 100644 --- a/generators/typescript/express/express-error-schema-generator/package.json +++ b/generators/typescript/express/express-error-schema-generator/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-inlined-request-body-generator/package.json b/generators/typescript/express/express-inlined-request-body-generator/package.json index d3f3a2279aa..a4bf58abdae 100644 --- a/generators/typescript/express/express-inlined-request-body-generator/package.json +++ b/generators/typescript/express/express-inlined-request-body-generator/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-inlined-request-body-schema-generator/package.json b/generators/typescript/express/express-inlined-request-body-schema-generator/package.json index d9ad5bf3a9c..236b76d2d57 100644 --- a/generators/typescript/express/express-inlined-request-body-schema-generator/package.json +++ b/generators/typescript/express/express-inlined-request-body-schema-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-register-generator/package.json b/generators/typescript/express/express-register-generator/package.json index fdf8a7dcc84..afc21e494e0 100644 --- a/generators/typescript/express/express-register-generator/package.json +++ b/generators/typescript/express/express-register-generator/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/express-service-generator/package.json b/generators/typescript/express/express-service-generator/package.json index eaaf11f53f6..65a2253fc7b 100644 --- a/generators/typescript/express/express-service-generator/package.json +++ b/generators/typescript/express/express-service-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/generator/package.json b/generators/typescript/express/generator/package.json index 34e3c6fced9..32527754000 100644 --- a/generators/typescript/express/generator/package.json +++ b/generators/typescript/express/generator/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/express/generic-express-error-generators/package.json b/generators/typescript/express/generic-express-error-generators/package.json index d8895b0a425..42ceeaf8c89 100644 --- a/generators/typescript/express/generic-express-error-generators/package.json +++ b/generators/typescript/express/generic-express-error-generators/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/type-generator/package.json b/generators/typescript/model/type-generator/package.json index cbd1e6ef757..acf421351ac 100644 --- a/generators/typescript/model/type-generator/package.json +++ b/generators/typescript/model/type-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/type-reference-converters/package.json b/generators/typescript/model/type-reference-converters/package.json index b0aa37c0cb6..ae92cf62d08 100644 --- a/generators/typescript/model/type-reference-converters/package.json +++ b/generators/typescript/model/type-reference-converters/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/type-reference-example-generator/package.json b/generators/typescript/model/type-reference-example-generator/package.json index 6da6bbba16e..3418745de04 100644 --- a/generators/typescript/model/type-reference-example-generator/package.json +++ b/generators/typescript/model/type-reference-example-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/type-schema-generator/package.json b/generators/typescript/model/type-schema-generator/package.json index d514a4c63e7..efe87a7981e 100644 --- a/generators/typescript/model/type-schema-generator/package.json +++ b/generators/typescript/model/type-schema-generator/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/union-generator/package.json b/generators/typescript/model/union-generator/package.json index e164ddaec97..39a825420e8 100644 --- a/generators/typescript/model/union-generator/package.json +++ b/generators/typescript/model/union-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/model/union-schema-generator/package.json b/generators/typescript/model/union-schema-generator/package.json index 148b10ef01c..d894eb6e01d 100644 --- a/generators/typescript/model/union-schema-generator/package.json +++ b/generators/typescript/model/union-schema-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/playground/browser/package.json b/generators/typescript/playground/browser/package.json index 84cb12ad308..cdcd9b17990 100644 --- a/generators/typescript/playground/browser/package.json +++ b/generators/typescript/playground/browser/package.json @@ -42,7 +42,7 @@ "url-join": "^5.0.0" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/node-fetch": "2.6.9", "@types/qs": "6.9.15", "@types/react": "^18.2.43", diff --git a/generators/typescript/sdk/cli/package.json b/generators/typescript/sdk/cli/package.json index bed8f4e9a20..c24e198da73 100644 --- a/generators/typescript/sdk/cli/package.json +++ b/generators/typescript/sdk/cli/package.json @@ -43,7 +43,7 @@ "@ts-morph/common": "^0.25.0", "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/tmp": "^0.2.4", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/generators/typescript/sdk/client-class-generator/package.json b/generators/typescript/sdk/client-class-generator/package.json index f56830b1533..59af85a3533 100644 --- a/generators/typescript/sdk/client-class-generator/package.json +++ b/generators/typescript/sdk/client-class-generator/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/endpoint-error-union-generator/package.json b/generators/typescript/sdk/endpoint-error-union-generator/package.json index 9418bd8cc98..3ef17f6739b 100644 --- a/generators/typescript/sdk/endpoint-error-union-generator/package.json +++ b/generators/typescript/sdk/endpoint-error-union-generator/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/environments-generator/package.json b/generators/typescript/sdk/environments-generator/package.json index a6e141bb2f5..0df2058a5c1 100644 --- a/generators/typescript/sdk/environments-generator/package.json +++ b/generators/typescript/sdk/environments-generator/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/generator/package.json b/generators/typescript/sdk/generator/package.json index dd61672d0ce..1f765909202 100644 --- a/generators/typescript/sdk/generator/package.json +++ b/generators/typescript/sdk/generator/package.json @@ -61,7 +61,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/jest-specific-snapshot": "^0.5.9", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/url-join": "4.0.1", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/generators/typescript/sdk/generic-sdk-error-generators/package.json b/generators/typescript/sdk/generic-sdk-error-generators/package.json index 09d6d255e3e..c794cdcd3c8 100644 --- a/generators/typescript/sdk/generic-sdk-error-generators/package.json +++ b/generators/typescript/sdk/generic-sdk-error-generators/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/request-wrapper-generator/package.json b/generators/typescript/sdk/request-wrapper-generator/package.json index 0a60ffeb5a5..7aa25b37684 100644 --- a/generators/typescript/sdk/request-wrapper-generator/package.json +++ b/generators/typescript/sdk/request-wrapper-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json index ff4efbdf41c..66563d4a7f6 100644 --- a/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json +++ b/generators/typescript/sdk/sdk-endpoint-type-schemas-generator/package.json @@ -38,7 +38,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/sdk-error-generator/package.json b/generators/typescript/sdk/sdk-error-generator/package.json index a02fcc257c5..3d3f4717c02 100644 --- a/generators/typescript/sdk/sdk-error-generator/package.json +++ b/generators/typescript/sdk/sdk-error-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/sdk-error-schema-generator/package.json b/generators/typescript/sdk/sdk-error-schema-generator/package.json index 6a376deda1a..01161699b5f 100644 --- a/generators/typescript/sdk/sdk-error-schema-generator/package.json +++ b/generators/typescript/sdk/sdk-error-schema-generator/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json b/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json index 2c8cc26d79a..09da1989934 100644 --- a/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json +++ b/generators/typescript/sdk/sdk-inlined-request-body-schema-generator/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/utils/abstract-error-class-generator/package.json b/generators/typescript/utils/abstract-error-class-generator/package.json index ba9b89d36fb..74fa988075d 100644 --- a/generators/typescript/utils/abstract-error-class-generator/package.json +++ b/generators/typescript/utils/abstract-error-class-generator/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/utils/abstract-generator-cli/package.json b/generators/typescript/utils/abstract-generator-cli/package.json index f304834137d..3027ca567a8 100644 --- a/generators/typescript/utils/abstract-generator-cli/package.json +++ b/generators/typescript/utils/abstract-generator-cli/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/utils/abstract-schema-generator/package.json b/generators/typescript/utils/abstract-schema-generator/package.json index e5a925edbbd..9e955843dac 100644 --- a/generators/typescript/utils/abstract-schema-generator/package.json +++ b/generators/typescript/utils/abstract-schema-generator/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/utils/commons/package.json b/generators/typescript/utils/commons/package.json index 89dc4cc2931..5718c3217c8 100644 --- a/generators/typescript/utils/commons/package.json +++ b/generators/typescript/utils/commons/package.json @@ -51,7 +51,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/url-join": "4.0.1", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/generators/typescript/utils/contexts/package.json b/generators/typescript/utils/contexts/package.json index 2c1aaadf535..5eac1164041 100644 --- a/generators/typescript/utils/contexts/package.json +++ b/generators/typescript/utils/contexts/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/generators/typescript/utils/core-utilities/auth/package.json b/generators/typescript/utils/core-utilities/auth/package.json index d5ff39ddd5f..6164dbd7924 100644 --- a/generators/typescript/utils/core-utilities/auth/package.json +++ b/generators/typescript/utils/core-utilities/auth/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "jest": "^29.7.0", diff --git a/generators/typescript/utils/core-utilities/base/package.json b/generators/typescript/utils/core-utilities/base/package.json index 1a2436ca57e..c0b98e529a1 100644 --- a/generators/typescript/utils/core-utilities/base/package.json +++ b/generators/typescript/utils/core-utilities/base/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "jest": "^29.7.0", diff --git a/generators/typescript/utils/core-utilities/callback-queue/package.json b/generators/typescript/utils/core-utilities/callback-queue/package.json index 1c9a15676b9..b50416b738d 100644 --- a/generators/typescript/utils/core-utilities/callback-queue/package.json +++ b/generators/typescript/utils/core-utilities/callback-queue/package.json @@ -27,7 +27,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "jest": "^29.7.0", diff --git a/generators/typescript/utils/core-utilities/fetcher/package.json b/generators/typescript/utils/core-utilities/fetcher/package.json index 14b8238c860..c6c2df862ad 100644 --- a/generators/typescript/utils/core-utilities/fetcher/package.json +++ b/generators/typescript/utils/core-utilities/fetcher/package.json @@ -37,7 +37,7 @@ "@types/express": "^4.17.21", "@types/jest": "^29.5.12", "@types/multer": "^1.4.11", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/node-fetch": "2.6.9", "@types/qs": "6.9.15", "@types/readable-stream": "^4.0.15", diff --git a/generators/typescript/utils/core-utilities/utils/package.json b/generators/typescript/utils/core-utilities/utils/package.json index e712807d5ac..920508d5ab0 100644 --- a/generators/typescript/utils/core-utilities/utils/package.json +++ b/generators/typescript/utils/core-utilities/utils/package.json @@ -27,7 +27,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "jest": "^29.7.0", diff --git a/generators/typescript/utils/core-utilities/zurg/package.json b/generators/typescript/utils/core-utilities/zurg/package.json index 0b612284cc6..00720bcfa3d 100644 --- a/generators/typescript/utils/core-utilities/zurg/package.json +++ b/generators/typescript/utils/core-utilities/zurg/package.json @@ -30,7 +30,7 @@ "@babel/preset-env": "^7.25.8", "@babel/preset-typescript": "^7.24.1", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "jest": "^29.7.0", diff --git a/generators/typescript/utils/resolvers/package.json b/generators/typescript/utils/resolvers/package.json index 882313bec23..6a736e25c1f 100644 --- a/generators/typescript/utils/resolvers/package.json +++ b/generators/typescript/utils/resolvers/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/package.json b/package.json index be60efa2606..f81382ddafe 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/is-ci": "^3.0.4", "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.6", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@typescript-eslint/eslint-plugin": "^5.27.1", "@typescript-eslint/parser": "^6.21.0", "chalk": "^5.0.1", diff --git a/packages/cli/api-importers/commons/package.json b/packages/cli/api-importers/commons/package.json index c15a57ea15d..6c266a61f33 100644 --- a/packages/cli/api-importers/commons/package.json +++ b/packages/cli/api-importers/commons/package.json @@ -35,7 +35,7 @@ "lodash-es": "^4.17.21" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "globals": "link:@types/vitest/globals", "organize-imports-cli": "^0.10.0", diff --git a/packages/cli/api-importers/conjure/conjure-sdk/package.json b/packages/cli/api-importers/conjure/conjure-sdk/package.json index e864f4d6f23..b291d75c179 100644 --- a/packages/cli/api-importers/conjure/conjure-sdk/package.json +++ b/packages/cli/api-importers/conjure/conjure-sdk/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/packages/cli/api-importers/conjure/conjure-to-fern-tests/package.json b/packages/cli/api-importers/conjure/conjure-to-fern-tests/package.json index 7c1ee001f46..6719e132fe0 100644 --- a/packages/cli/api-importers/conjure/conjure-to-fern-tests/package.json +++ b/packages/cli/api-importers/conjure/conjure-to-fern-tests/package.json @@ -33,7 +33,7 @@ "@fern-api/workspace-loader": "workspace:*" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/api-importers/conjure/conjure-to-fern/package.json b/packages/cli/api-importers/conjure/conjure-to-fern/package.json index a94c8a2cd6b..009e0c04567 100644 --- a/packages/cli/api-importers/conjure/conjure-to-fern/package.json +++ b/packages/cli/api-importers/conjure/conjure-to-fern/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "globals": "link:@types/vitest/globals", "organize-imports-cli": "^0.10.0", diff --git a/packages/cli/api-importers/openapi/openapi-ir-parser/package.json b/packages/cli/api-importers/openapi/openapi-ir-parser/package.json index c58007e131a..6be8f38d044 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-parser/package.json +++ b/packages/cli/api-importers/openapi/openapi-ir-parser/package.json @@ -43,7 +43,7 @@ "devDependencies": { "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/swagger2openapi": "^7.0.4", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/package.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/package.json index 8f483a88a58..5adf79f9dbe 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/package.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern-tests/package.json @@ -34,7 +34,7 @@ "@fern-api/workspace-loader": "workspace:*" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/api-importers/openapi/openapi-ir-to-fern/package.json b/packages/cli/api-importers/openapi/openapi-ir-to-fern/package.json index 85adc3277ac..0df656278ae 100644 --- a/packages/cli/api-importers/openapi/openapi-ir-to-fern/package.json +++ b/packages/cli/api-importers/openapi/openapi-ir-to-fern/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/api-importers/openapi/openapi-ir/package.json b/packages/cli/api-importers/openapi/openapi-ir/package.json index f82fd9617a8..c1bd1ae8d45 100644 --- a/packages/cli/api-importers/openapi/openapi-ir/package.json +++ b/packages/cli/api-importers/openapi/openapi-ir/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/auth/package.json b/packages/cli/auth/package.json index 132aee13c03..4d54d4e541e 100644 --- a/packages/cli/auth/package.json +++ b/packages/cli/auth/package.json @@ -39,7 +39,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/jsonwebtoken": "^9.0.6", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/cli-migrations/package.json b/packages/cli/cli-migrations/package.json index 88e4aebd1e3..13719bf690c 100644 --- a/packages/cli/cli-migrations/package.json +++ b/packages/cli/cli-migrations/package.json @@ -47,7 +47,7 @@ "@types/inquirer": "^9.0.7", "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/packages/cli/cli/package.json b/packages/cli/cli/package.json index 324c7bb9738..8dfb368da9b 100644 --- a/packages/cli/cli/package.json +++ b/packages/cli/cli/package.json @@ -73,6 +73,7 @@ "@fern-api/workspace-loader": "workspace:*", "@fern-fern/fiddle-sdk": "0.0.584", "@fern-fern/generators-sdk": "0.114.0-5745f9e74", + "@fern-api/ir-to-jsonschema": "workspace:*", "@types/axios": "^0.14.0", "@types/boxen": "^3.0.1", "@types/get-port": "^4.2.0", @@ -81,7 +82,7 @@ "@types/js-yaml": "^4.0.8", "@types/latest-version": "^4.0.1", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/tar": "^6.1.11", "@types/validate-npm-package-name": "^4.0.0", "@types/yargs": "^17.0.28", diff --git a/packages/cli/cli/src/cli.ts b/packages/cli/cli/src/cli.ts index 15532b94b34..fa3d9481344 100644 --- a/packages/cli/cli/src/cli.ts +++ b/packages/cli/cli/src/cli.ts @@ -40,6 +40,7 @@ import { writeDefinitionForWorkspaces } from "./commands/write-definition/writeD import { FERN_CWD_ENV_VAR } from "./cwd"; import { rerunFernCliAtVersion } from "./rerunFernCliAtVersion"; import { isURL } from "./utils/isUrl"; +import { generateJsonschemaForWorkspaces } from "./commands/jsonschema/generateJsonschemaForWorkspace"; void runCli(); @@ -154,6 +155,7 @@ async function tryRunCli(cliContext: CliContext) { cliContext.suppressUpgradeMessage(); } }); + addGenerateJsonschemaCommand(cli, cliContext); // CLI V2 Sanctioned Commands addGetOrganizationCommand(cli, cliContext); @@ -907,3 +909,43 @@ function addDocsPreviewCommand(cli: Argv, cliContext: CliConte } ); } + +function addGenerateJsonschemaCommand(cli: Argv, cliContext: CliContext) { + cli.command( + "jsonschema ", + "Generate JSON Schema for a specific type", + (yargs) => + yargs + .option("api", { + string: true, + description: "Only run the command on the provided API" + }) + .positional("path-to-output", { + type: "string", + description: "Path to write JSON Schema", + demandOption: true + }) + .option("type", { + string: true, + demandOption: true, + description: "The type to generate JSON Schema for (e.g. 'MySchema' or 'mypackage.MySchema')" + }), + async (argv) => { + await cliContext.instrumentPostHogEvent({ + command: "fern jsonschema", + properties: { + output: argv.output + } + }); + await generateJsonschemaForWorkspaces({ + typeLocator: argv.type, + project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, { + commandLineApiWorkspace: argv.api, + defaultToAllApiWorkspaces: false + }), + jsonschemaFilepath: resolve(cwd(), argv.pathToOutput), + cliContext + }); + } + ); +} diff --git a/packages/cli/cli/src/commands/jsonschema/generateJsonschemaForWorkspace.ts b/packages/cli/cli/src/commands/jsonschema/generateJsonschemaForWorkspace.ts new file mode 100644 index 00000000000..4036d3d7780 --- /dev/null +++ b/packages/cli/cli/src/commands/jsonschema/generateJsonschemaForWorkspace.ts @@ -0,0 +1,80 @@ +import { FERN_PACKAGE_MARKER_FILENAME } from "@fern-api/configuration"; +import { AbsoluteFilePath, doesPathExist, RelativeFilePath, dirname } from "@fern-api/fs-utils"; +import { Project } from "@fern-api/project-loader"; +import { CliContext } from "../../cli-context/CliContext"; +import { convertIRtoJsonSchema } from "@fern-api/ir-to-jsonschema"; +import { + IdGenerator, + generateIntermediateRepresentation, + constructCasingsGenerator, + convertToFernFilepath +} from "@fern-api/ir-generator"; +import { mkdir, writeFile } from "fs/promises"; +import chalk from "chalk"; + +export async function generateJsonschemaForWorkspaces({ + typeLocator, + project, + jsonschemaFilepath, + cliContext +}: { + // e.g. "MySchema" or "mypackage.MySchema" + typeLocator: string; + project: Project; + jsonschemaFilepath: AbsoluteFilePath; + cliContext: CliContext; +}): Promise { + await Promise.all( + project.apiWorkspaces.map(async (workspace) => { + await cliContext.runTaskForWorkspace(workspace, async (context) => { + const fernWorkspace = await workspace.toFernWorkspace({ context }); + + const intermediateRepresentation = await generateIntermediateRepresentation({ + workspace: fernWorkspace, + context, + generationLanguage: undefined, + audiences: { type: "all" }, + keywords: undefined, + smartCasing: false, + disableExamples: true, + version: undefined, + packageName: undefined, + readme: undefined + }); + + const splitTypeLocator = typeLocator.split("."); + const casingsGenerator = constructCasingsGenerator({ + generationLanguage: undefined, + keywords: undefined, + smartCasing: false + }); + const typeName = splitTypeLocator[splitTypeLocator.length - 1] ?? typeLocator; + const relativeFilepath = + splitTypeLocator.length > 1 + ? `${splitTypeLocator.slice(0, -1).join("/")}.yml` + : FERN_PACKAGE_MARKER_FILENAME; + const typeId = IdGenerator.generateTypeId({ + fernFilepath: convertToFernFilepath({ + relativeFilepath: RelativeFilePath.of(`${splitTypeLocator.slice(0, -1).join("/")}.yml`), + casingsGenerator + }), + name: casingsGenerator.generateName(typeName) + }); + + const jsonSchema = convertIRtoJsonSchema({ + ir: intermediateRepresentation, + typeName, + typeId, + context + }); + + if (!(await doesPathExist(dirname(jsonschemaFilepath)))) { + await mkdir(dirname(jsonschemaFilepath), { recursive: true }); + } + await writeFile(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2)); + + context.logger.info(chalk.green(`Wrote JSON Schema to ${jsonschemaFilepath}`)); + }); + }) + ); +} diff --git a/packages/cli/cli/tsconfig.json b/packages/cli/cli/tsconfig.json index 02470ff0986..04d471d3230 100644 --- a/packages/cli/cli/tsconfig.json +++ b/packages/cli/cli/tsconfig.json @@ -34,6 +34,7 @@ { "path": "../fern-definition/formatter" }, { "path": "../fern-definition/validator" }, { "path": "../cli-migrations" }, - { "path": "../fern-definition/schema" } + { "path": "../fern-definition/schema" }, + { "path": "../fern-definition/ir-to-jsonschema" } ] } diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index ae4c43bd71e..3d4a641b788 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,15 @@ +- changelogEntry: + - summary: | + Introduce a new command `fern jsonschema --type ` + that outputs the JSON Schema for a given type in your Fern Definition. + + ```sh + fern jsonschema ./schema.json --type MyType + ``` + type: feat + irVersion: 53 + version: 0.45.0-rc5 + - changelogEntry: - summary: | SCIM has been added as a common initialism. diff --git a/packages/cli/configuration/package.json b/packages/cli/configuration/package.json index 91b9f1a3e52..296fff5fe5b 100644 --- a/packages/cli/configuration/package.json +++ b/packages/cli/configuration/package.json @@ -47,7 +47,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/semver": "^7.5.8", "@types/tinycolor2": "^1.4.6", "depcheck": "^1.4.6", @@ -57,4 +57,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/docs-importers/commons/package.json b/packages/cli/docs-importers/commons/package.json index 06e5f80555f..45a3b785bb4 100644 --- a/packages/cli/docs-importers/commons/package.json +++ b/packages/cli/docs-importers/commons/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/docs-importers/mintlify/package.json b/packages/cli/docs-importers/mintlify/package.json index acc9dcfc8ad..cfdb47b4b45 100644 --- a/packages/cli/docs-importers/mintlify/package.json +++ b/packages/cli/docs-importers/mintlify/package.json @@ -38,7 +38,7 @@ "gray-matter": "^4.0.3" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/docs-markdown-utils/package.json b/packages/cli/docs-markdown-utils/package.json index bd6a1dcf9c2..dad386697f9 100644 --- a/packages/cli/docs-markdown-utils/package.json +++ b/packages/cli/docs-markdown-utils/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@types/diff": "^5.2.1", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "diff": "^5.2.0", "eslint": "^8.56.0", @@ -49,4 +49,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/docs-preview/package.json b/packages/cli/docs-preview/package.json index 882b0c3eab5..d28d9906a41 100644 --- a/packages/cli/docs-preview/package.json +++ b/packages/cli/docs-preview/package.json @@ -28,11 +28,11 @@ "depcheck": "depcheck" }, "dependencies": { - "@fern-api/docs-resolver": "workspace:*", + "@fern-api/docs-resolver": "workspace:*", "@fern-api/fdr-sdk": "0.115.0-3cf21db72", "@fern-api/fs-utils": "workspace:*", "@fern-api/ir-sdk": "workspace:*", - "@fern-api/logger": "workspace:*", + "@fern-api/logger": "workspace:*", "@fern-api/project-loader": "workspace:*", "@fern-api/register": "workspace:*", "@fern-api/task-context": "workspace:*", @@ -50,7 +50,7 @@ "@types/cors": "^2.8.13", "@types/decompress": "^4.2.7", "@types/express": "^4.17.21", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/uuid": "^9.0.8", "@types/ws": "^8.5.10", "@types/xml2js": "^0.4.14", @@ -62,4 +62,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/docs-resolver/package.json b/packages/cli/docs-resolver/package.json index f879307e332..7ca162546df 100644 --- a/packages/cli/docs-resolver/package.json +++ b/packages/cli/docs-resolver/package.json @@ -25,13 +25,13 @@ "format:check": "prettier --check --ignore-unknown --ignore-path ../../../shared/.prettierignore \"**\"", "organize-imports": "organize-imports-cli tsconfig.json", "depcheck": "depcheck" - }, + }, "dependencies": { "@fern-api/configuration": "workspace:*", "@fern-api/core-utils": "workspace:*", "@fern-api/docs-markdown-utils": "workspace:*", "@fern-api/fdr-sdk": "0.115.0-3cf21db72", - "@fern-api/ui-core-utils": "0.115.0-3cf21db72", + "@fern-api/ui-core-utils": "0.115.0-3cf21db72", "@fern-api/fs-utils": "workspace:*", "@fern-api/ir-generator": "workspace:*", "@fern-api/ir-sdk": "workspace:*", @@ -45,7 +45,7 @@ "devDependencies": { "@fern-api/workspace-loader": "workspace:*", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", @@ -54,4 +54,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/ete-tests/package.json b/packages/cli/ete-tests/package.json index e5a00f2d623..f991f44f6eb 100644 --- a/packages/cli/ete-tests/package.json +++ b/packages/cli/ete-tests/package.json @@ -42,7 +42,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/node-fetch": "2.6.9", "depcheck": "^1.4.6", "eslint": "^8.56.0", @@ -54,4 +54,4 @@ "prettier": "^2.7.1", "typescript": "4.6.4" } -} +} \ No newline at end of file diff --git a/packages/cli/ete-tests/src/tests/help/__snapshots__/help.test.ts.snap b/packages/cli/ete-tests/src/tests/help/__snapshots__/help.test.ts.snap index fe41d695085..ad693732aeb 100644 --- a/packages/cli/ete-tests/src/tests/help/__snapshots__/help.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/help/__snapshots__/help.test.ts.snap @@ -4,31 +4,37 @@ exports[`help > no arguments 1`] = ` "fern-dev Commands: - fern-dev init Initialize a Fern API - fern-dev token Generate a Fern Token - fern-dev add Add a code generator to generators.yml - fern-dev generate Generate all generators in the specified group - fern-dev ir Generate IR (Intermediate Representation) - fern-dev check Validates your Fern Definition. Logs errors. - fern-dev login Log in to Fern via GitHub - fern-dev format Formats your Fern Definition - fern-dev write-definition Write underlying Fern Definition for OpenAPI - specs and API Dependencies. - fern-dev docs dev Run a local development server to preview your - docs - fern-dev mock Starts a mock server for an API. - fern-dev write-overrides Generate a basic openapi overrides file. - fern-dev test Runs tests specified in --command, this spins up - a mock server in the background that is - terminated upon completion of the tests. - fern-dev api update Pulls the latest OpenAPI spec from the specified - origin in generators.yml and updates the local - spec. - fern-dev upgrade Upgrades version in fern.config.json. Also - upgrades generators in generators.yml to their - minimum-compatible versions. - fern-dev generator Operate on the generators within your Fern - configuration + fern-dev init Initialize a Fern API + fern-dev token Generate a Fern Token + fern-dev add Add a code generator to generators.yml + fern-dev generate Generate all generators in the specified + group + fern-dev ir Generate IR (Intermediate + Representation) + fern-dev check Validates your Fern Definition. Logs + errors. + fern-dev login Log in to Fern via GitHub + fern-dev format Formats your Fern Definition + fern-dev write-definition Write underlying Fern Definition for + OpenAPI specs and API Dependencies. + fern-dev docs dev Run a local development server to + preview your docs + fern-dev mock Starts a mock server for an API. + fern-dev write-overrides Generate a basic openapi overrides file. + fern-dev test Runs tests specified in --command, this + spins up a mock server in the background + that is terminated upon completion of + the tests. + fern-dev api update Pulls the latest OpenAPI spec from the + specified origin in generators.yml and + updates the local spec. + fern-dev upgrade Upgrades version in fern.config.json. + Also upgrades generators in + generators.yml to their + minimum-compatible versions. + fern-dev jsonschema Generate JSON Schema for a specific type + fern-dev generator Operate on the generators within your + Fern configuration Options: --help Show help [boolean] diff --git a/packages/cli/ete-tests/src/tests/jsonschema/__snapshots__/jsonschema.test.ts.snap b/packages/cli/ete-tests/src/tests/jsonschema/__snapshots__/jsonschema.test.ts.snap new file mode 100644 index 00000000000..aa29a706de1 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/jsonschema/__snapshots__/jsonschema.test.ts.snap @@ -0,0 +1,28 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`jsonschema > works with latest version 1`] = ` +{ + "definitions": { + "imdb.MovieId": { + "type": "string", + }, + }, + "properties": { + "id": { + "$ref": "#/definitions/imdb.MovieId", + }, + "rating": { + "type": "number", + }, + "title": { + "type": "string", + }, + }, + "required": [ + "id", + "title", + "rating", + ], + "type": "object", +} +`; diff --git a/packages/cli/ete-tests/src/tests/jsonschema/jsonschema.test.ts b/packages/cli/ete-tests/src/tests/jsonschema/jsonschema.test.ts new file mode 100644 index 00000000000..c5423f371a0 --- /dev/null +++ b/packages/cli/ete-tests/src/tests/jsonschema/jsonschema.test.ts @@ -0,0 +1,19 @@ +import { join, RelativeFilePath } from "@fern-api/fs-utils"; +import { runFernCli } from "../../utils/runFernCli"; +import { init } from "../init/init"; +import { readFile } from "fs/promises"; + +describe("jsonschema", () => { + it("works with latest version", async () => { + const pathOfDirectory = await init(); + await runFernCli(["jsonschema", "schema.json", "--type", "imdb.Movie"], { + cwd: pathOfDirectory, + reject: false + }); + + const jsonSchema = JSON.parse( + await readFile(join(pathOfDirectory, RelativeFilePath.of("schema.json")), "utf-8") + ); + expect(jsonSchema).toMatchSnapshot(); + }, 10_000); +}); diff --git a/packages/cli/fern-definition/formatter/package.json b/packages/cli/fern-definition/formatter/package.json index e62a3ba1aaf..2e917c7c99c 100644 --- a/packages/cli/fern-definition/formatter/package.json +++ b/packages/cli/fern-definition/formatter/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/prettier": "^2.7.1", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/fern-definition/ir-to-jsonschema/.depcheckrc.json b/packages/cli/fern-definition/ir-to-jsonschema/.depcheckrc.json new file mode 100644 index 00000000000..a3a4f43188c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/.depcheckrc.json @@ -0,0 +1,10 @@ +{ + "ignores": [ + "@types/jest", + "globals", + "@types/node" + ], + "ignore-patterns": [ + "lib" + ] +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/.prettierrc.cjs b/packages/cli/fern-definition/ir-to-jsonschema/.prettierrc.cjs new file mode 100644 index 00000000000..9b6214d5129 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/.prettierrc.cjs @@ -0,0 +1 @@ +module.exports = require("../../../../.prettierrc.json"); diff --git a/packages/cli/fern-definition/ir-to-jsonschema/package.json b/packages/cli/fern-definition/ir-to-jsonschema/package.json new file mode 100644 index 00000000000..9bfa2fabe30 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/package.json @@ -0,0 +1,49 @@ +{ + "name": "@fern-api/ir-to-jsonschema", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/fern-api/fern.git", + "directory": "packages/cli/yaml/validator" + }, + "private": true, + "files": [ + "lib" + ], + "type": "module", + "source": "src/index.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "sideEffects": false, + "scripts": { + "clean": "rm -rf ./lib && tsc --build --clean", + "compile": "tsc --build", + "test": "vitest --run", + "test:update": "vitest --run -u", + "lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../../.eslintignore", + "lint:eslint:fix": "yarn lint:eslint --fix", + "format": "prettier --write --ignore-unknown --ignore-path ../../../../shared/.prettierignore \"**\"", + "format:check": "prettier --check --ignore-unknown --ignore-path ../../../../shared/.prettierignore \"**\"", + "organize-imports": "organize-imports-cli tsconfig.json", + "depcheck": "depcheck" + }, + "dependencies": { + "@fern-api/core-utils": "workspace:*", + "@fern-api/ir-sdk": "workspace:*", + "@fern-api/task-context": "workspace:*", + "@fern-api/fs-utils": "workspace:*", + "@fern-api/project-loader": "workspace:*", + "@fern-api/ir-generator": "workspace:*", + "json-schema": "^0.4.0" + }, + "devDependencies": { + "@types/json-schema": "^7.0.15", + "@types/node": "18.7.18", + "depcheck": "^1.4.6", + "eslint": "^8.56.0", + "organize-imports-cli": "^0.10.0", + "prettier": "^2.7.1", + "typescript": "4.6.4", + "vitest": "^2.0.5" + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/JsonSchemaConverterContext.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/JsonSchemaConverterContext.ts new file mode 100644 index 00000000000..fffea62a098 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/JsonSchemaConverterContext.ts @@ -0,0 +1,70 @@ +import { IntermediateRepresentation, TypeDeclaration, TypeId, TypeReference } from "@fern-api/ir-sdk"; +import { TaskContext } from "@fern-api/task-context"; +import { JSONSchema4 } from "json-schema"; + +export class JsonSchemaConverterContext { + private readonly buildingTypeIds: Set = new Set(); + private readonly definitions: Record = {}; + + constructor(private readonly context: TaskContext, private readonly ir: IntermediateRepresentation) {} + + public getTypeDeclarationForId({ typeName, typeId }: { typeId: TypeId; typeName?: string }): TypeDeclaration { + const typeDeclaration = this.ir.types[typeId]; + if (typeDeclaration == null) { + if (typeName != null) { + this.context.logger.error(`Type ${typeName} not found`); + } else { + // context.logger.error(`Type declaration not found for ${typeName}`); + } + return this.context.failAndThrow(); + } + return typeDeclaration; + } + + public isOptional(typeReference: TypeReference): boolean { + if (typeReference.type === "container" && typeReference.container.type === "optional") { + return true; + } + if (typeReference.type === "named") { + const typeDeclaration = this.getTypeDeclarationForId({ typeId: typeReference.typeId }); + if (typeDeclaration.shape.type === "alias") { + return this.isOptional(typeDeclaration.shape.aliasOf); + } + } + return false; + } + + public registerDefinition(typeId: TypeId, schema: JSONSchema4): void { + const typeDeclaration = this.getTypeDeclarationForId({ typeId }); + this.definitions[this.getDefinitionKey(typeDeclaration)] = schema; + } + + public getDefinitions(): Record { + return this.definitions; + } + + public hasDefinition(typeId: TypeId): boolean { + const typeDeclaration = this.getTypeDeclarationForId({ typeId }); + const definitionKey = this.getDefinitionKey(typeDeclaration); + return definitionKey in this.definitions; + } + + public getDefinitionKey(typeDeclaration: TypeDeclaration): string { + return [ + ...typeDeclaration.name.fernFilepath.allParts.map((part) => part.originalName), + typeDeclaration.name.name.originalName + ].join("."); + } + + public buildingTypeDeclaration(typeId: TypeId): void { + this.buildingTypeIds.add(typeId); + } + + public finishedBuildingTypeDeclaration(typeId: TypeId): void { + this.buildingTypeIds.delete(typeId); + } + + public isBuildingTypeDeclaration(typeId: TypeId): boolean { + return this.buildingTypeIds.has(typeId); + } +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:AliasType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:AliasType.json new file mode 100644 index 00000000000..441d6c36f87 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:AliasType.json @@ -0,0 +1,16 @@ +{ + "$ref": "#/definitions/Parent", + "definitions": { + "Parent": { + "type": "object", + "properties": { + "parent": { + "type": "string" + } + }, + "required": [ + "parent" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Child.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Child.json new file mode 100644 index 00000000000..d3544770ff1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Child.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "child": { + "type": "string" + } + }, + "required": [ + "child" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Parent.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Parent.json new file mode 100644 index 00000000000..e5ec4cd7ee5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type_:Parent.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "parent": { + "type": "string" + } + }, + "required": [ + "parent" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Object.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Object.json new file mode 100644 index 00000000000..5020d42c534 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Object.json @@ -0,0 +1,23 @@ +{ + "$ref": "#/definitions/Type", + "definitions": { + "TypeId": { + "type": "string" + }, + "Type": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/TypeId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Type.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Type.json new file mode 100644 index 00000000000..79f4d6375ed --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:Type.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/TypeId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": { + "TypeId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:TypeId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:TypeId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type_:TypeId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_auth:TokenResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_auth:TokenResponse.json new file mode 100644 index 00000000000..9e24796eec8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_auth:TokenResponse.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "type": "string" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_user:User.json new file mode 100644 index 00000000000..ad25119f9c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_user:User.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_commons:Imported.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_commons:Imported.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_commons:Imported.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-a/service:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-a/service:Response.json new file mode 100644 index 00000000000..49ccdac4c51 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-a/service:Response.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-b.common.Foo" + } + }, + "definitions": { + "folder-c.common.FolderCFoo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ] + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-c.common.FolderCFoo" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-b/common:Foo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-b/common:Foo.json new file mode 100644 index 00000000000..11f479033d1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-b/common:Foo.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-c.common.FolderCFoo" + } + }, + "definitions": { + "folder-c.common.FolderCFoo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-c/common:FolderCFoo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-c/common:FolderCFoo.json new file mode 100644 index 00000000000..d75ce091d9d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-c/common:FolderCFoo.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-d/service:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-d/service:Response.json new file mode 100644 index 00000000000..b6d40e2a46f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-d/service:Response.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:FilteredType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:FilteredType.json new file mode 100644 index 00000000000..d0e17c0cfad --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:FilteredType.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "public_property": { + "type": "string" + }, + "private_property": { + "type": "integer" + } + }, + "required": [ + "private_property" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:ImportingType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:ImportingType.json new file mode 100644 index 00000000000..9cf9643249c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:ImportingType.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "imported": { + "$ref": "#/definitions/commons.Imported" + } + }, + "required": [ + "imported" + ], + "definitions": { + "commons.Imported": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:OptionalString.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:OptionalString.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo:OptionalString.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth-environment-variables/type_errors:UnauthorizedRequestErrorBody.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth-environment-variables/type_errors:UnauthorizedRequestErrorBody.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth-environment-variables/type_errors:UnauthorizedRequestErrorBody.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth/type_errors:UnauthorizedRequestErrorBody.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth/type_errors:UnauthorizedRequestErrorBody.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth/type_errors:UnauthorizedRequestErrorBody.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:ImportingA.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:ImportingA.json new file mode 100644 index 00000000000..e0f39d12820 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:ImportingA.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.A" + } + }, + "definitions": { + "a.A": { + "type": "object", + "properties": {} + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:RootType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:RootType.json new file mode 100644 index 00000000000..ebb86ba2ea9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_:RootType.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_a:A.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_a:A.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_a:A.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ContainerValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ContainerValue.json new file mode 100644 index 00000000000..2ab62d83fcc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ContainerValue.json @@ -0,0 +1,155 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.PrimitiveValue": { + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ] + }, + "ast.ContainerValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.FieldValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldName.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldName.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldName.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldValue.json new file mode 100644 index 00000000000..c1a14fff5d0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:FieldValue.json @@ -0,0 +1,163 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.PrimitiveValue": { + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ] + }, + "ast.FieldValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.ContainerValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectFieldValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectFieldValue.json new file mode 100644 index 00000000000..02c902d0f6f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectFieldValue.json @@ -0,0 +1,127 @@ +{ + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/ast.FieldName" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "name", + "value" + ], + "definitions": { + "ast.FieldName": { + "type": "string" + }, + "ast.PrimitiveValue": { + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ] + }, + "ast.ContainerValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.FieldValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectValue.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:ObjectValue.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:PrimitiveValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:PrimitiveValue.json new file mode 100644 index 00000000000..bb183af84d8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast:PrimitiveValue.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:ImportingA.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:ImportingA.json new file mode 100644 index 00000000000..e0f39d12820 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:ImportingA.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.A" + } + }, + "definitions": { + "a.A": { + "type": "object", + "properties": {} + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:RootType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:RootType.json new file mode 100644 index 00000000000..ebb86ba2ea9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_:RootType.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_a:A.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_a:A.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_a:A.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ContainerValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ContainerValue.json new file mode 100644 index 00000000000..2ab62d83fcc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ContainerValue.json @@ -0,0 +1,155 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.PrimitiveValue": { + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ] + }, + "ast.ContainerValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.FieldValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:FieldValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:FieldValue.json new file mode 100644 index 00000000000..c1a14fff5d0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:FieldValue.json @@ -0,0 +1,163 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "ast.PrimitiveValue": { + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ] + }, + "ast.FieldValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primitive_value", + "object_value", + "container_value" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "primitive_value" + }, + "value": { + "$ref": "#/definitions/ast.PrimitiveValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "object_value" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "container_value" + }, + "value": { + "$ref": "#/definitions/ast.ContainerValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "ast.ContainerValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list", + "optional" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "list" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/ast.FieldValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "optional" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:JsonLike.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:JsonLike.json new file mode 100644 index 00000000000..41217908e03 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:JsonLike.json @@ -0,0 +1,52 @@ +{ + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "definitions": { + "ast.JsonLike": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ObjectValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ObjectValue.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:ObjectValue.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:PrimitiveValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:PrimitiveValue.json new file mode 100644 index 00000000000..bb183af84d8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast:PrimitiveValue.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "STRING", + "NUMBER" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_commons:Imported.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_commons:Imported.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_commons:Imported.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-a/service:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-a/service:Response.json new file mode 100644 index 00000000000..ee571bf80c8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-a/service:Response.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-b.common.Foo" + } + }, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ] + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-c.common.Foo" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-b/common:Foo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-b/common:Foo.json new file mode 100644 index 00000000000..8d0e3057c43 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-b/common:Foo.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-c.common.Foo" + } + }, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-c/common:Foo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-c/common:Foo.json new file mode 100644 index 00000000000..d75ce091d9d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-c/common:Foo.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-d/service:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-d/service:Response.json new file mode 100644 index 00000000000..ee571bf80c8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_folder-d/service:Response.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-b.common.Foo" + } + }, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ] + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "$ref": "#/definitions/folder-c.common.Foo" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:ImportingType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:ImportingType.json new file mode 100644 index 00000000000..9cf9643249c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:ImportingType.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "imported": { + "$ref": "#/definitions/commons.Imported" + } + }, + "required": [ + "imported" + ], + "definitions": { + "commons.Imported": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:OptionalString.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:OptionalString.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo:OptionalString.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:A.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:A.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:A.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:B.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:B.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:B.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:SubTestType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:SubTestType.json new file mode 100644 index 00000000000..398fb06956c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa:SubTestType.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.aa.A" + }, + "b": { + "$ref": "#/definitions/a.aa.B" + } + }, + "required": [ + "a", + "b" + ], + "definitions": { + "a.aa.A": { + "type": "object", + "properties": {} + }, + "a.aa.B": { + "type": "object", + "properties": {} + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_b:TestType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_b:TestType.json new file mode 100644 index 00000000000..398fb06956c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_b:TestType.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.aa.A" + }, + "b": { + "$ref": "#/definitions/a.aa.B" + } + }, + "required": [ + "a", + "b" + ], + "definitions": { + "a.aa.A": { + "type": "object", + "properties": {} + }, + "a.aa.B": { + "type": "object", + "properties": {} + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_tasktest:Task.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_tasktest:Task.json new file mode 100644 index 00000000000..a9bdf5a00c8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_tasktest:Task.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/custom-auth/type_errors:UnauthorizedRequestErrorBody.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/custom-auth/type_errors:UnauthorizedRequestErrorBody.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/custom-auth/type_errors:UnauthorizedRequestErrorBody.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Color.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Color.json new file mode 100644 index 00000000000..9239212542d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Color.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "red", + "blue" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:ColorOrOperand.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:ColorOrOperand.json new file mode 100644 index 00000000000..8e1aa438a18 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:ColorOrOperand.json @@ -0,0 +1,27 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/Color" + }, + { + "$ref": "#/definitions/Operand" + } + ], + "definitions": { + "Color": { + "type": "string", + "enum": [ + "red", + "blue" + ] + }, + "Operand": { + "type": "string", + "enum": [ + ">", + "=", + "less_than" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Operand.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Operand.json new file mode 100644 index 00000000000..daf62cdba2c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type_:Operand.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + ">", + "=", + "less_than" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/error-property/type_errors:PropertyBasedErrorTestBody.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/error-property/type_errors:PropertyBasedErrorTestBody.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/error-property/type_errors:PropertyBasedErrorTestBody.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:BasicType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:BasicType.json new file mode 100644 index 00000000000..e478f070447 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:BasicType.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "primitive", + "literal" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:ComplexType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:ComplexType.json new file mode 100644 index 00000000000..84f4e7a2d9b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:ComplexType.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Identifier.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Identifier.json new file mode 100644 index 00000000000..5e0cede24d9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Identifier.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "type", + "value", + "label" + ], + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "oneOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Type.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Type.json new file mode 100644 index 00000000000..6d4ff2ff4a2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_:Type.json @@ -0,0 +1,27 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ], + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Data.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Data.json new file mode 100644 index 00000000000..7d0e3e6ea91 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Data.json @@ -0,0 +1,45 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "base64" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "base64" + }, + "value": { + "type": "string", + "contentEncoding": "base64" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:EventInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:EventInfo.json new file mode 100644 index 00000000000..cb67ded23c0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:EventInfo.json @@ -0,0 +1,58 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "metadata", + "tag" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "metadata" + }, + "id": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "jsonString": { + "type": "string" + } + }, + "required": [ + "type", + "id" + ] + }, + { + "properties": { + "type": { + "const": "tag" + }, + "value": { + "$ref": "#/definitions/commons.types.Tag" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.types.Tag": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Metadata.json new file mode 100644 index 00000000000..2e7197ce24a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Metadata.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "jsonString": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Tag.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Tag.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types:Tag.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_file/service:Filename.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_file/service:Filename.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_file/service:Filename.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actor.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actor.json new file mode 100644 index 00000000000..acb66233a50 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actor.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actress.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actress.json new file mode 100644 index 00000000000..acb66233a50 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Actress.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:CastMember.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:CastMember.json new file mode 100644 index 00000000000..ab71bee3011 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:CastMember.json @@ -0,0 +1,60 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/types.Actor" + }, + { + "$ref": "#/definitions/types.Actress" + }, + { + "$ref": "#/definitions/types.StuntDouble" + } + ], + "definitions": { + "types.Actor": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "types.Actress": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ] + }, + "types.StuntDouble": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "actorOrActressId": { + "type": "string" + } + }, + "required": [ + "name", + "actorOrActressId" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Directory.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Directory.json new file mode 100644 index 00000000000..85d49adbac2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Directory.json @@ -0,0 +1,63 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/types.File" + } + }, + "directories": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Directory" + } + } + }, + "required": [ + "name" + ], + "definitions": { + "types.File": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "name", + "contents" + ] + }, + "types.Directory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/types.File" + } + }, + "directories": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Directory" + } + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Entity.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Entity.json new file mode 100644 index 00000000000..a1f1ad522ec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Entity.json @@ -0,0 +1,42 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ], + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "oneOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Exception.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Exception.json new file mode 100644 index 00000000000..66279ff901b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Exception.json @@ -0,0 +1,50 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExceptionInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExceptionInfo.json new file mode 100644 index 00000000000..3ad4590f574 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExceptionInfo.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExtendedMovie.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExtendedMovie.json new file mode 100644 index 00000000000..6b8053c4796 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ExtendedMovie.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "cast": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "cast" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:File.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:File.json new file mode 100644 index 00000000000..e6637cbf089 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:File.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "name", + "contents" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Metadata.json new file mode 100644 index 00000000000..efdd64eed3d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Metadata.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "markdown" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "markdown" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Migration.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Migration.json new file mode 100644 index 00000000000..082f45e4916 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Migration.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/types.MigrationStatus" + } + }, + "required": [ + "name", + "status" + ], + "definitions": { + "types.MigrationStatus": { + "type": "string", + "enum": [ + "RUNNING", + "FAILED", + "FINISHED" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MigrationStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MigrationStatus.json new file mode 100644 index 00000000000..850d83b48b5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MigrationStatus.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "RUNNING", + "FAILED", + "FINISHED" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Moment.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Moment.json new file mode 100644 index 00000000000..d86ef97da54 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Moment.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "date": { + "type": "string", + "format": "date" + }, + "datetime": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "date", + "datetime" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Movie.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Movie.json new file mode 100644 index 00000000000..cbfa55d6395 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Movie.json @@ -0,0 +1,66 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/types.MovieId" + }, + "prequel": { + "$ref": "#/definitions/types.MovieId" + }, + "title": { + "type": "string" + }, + "from": { + "type": "string" + }, + "rating": { + "type": "number" + }, + "type": { + "const": { + "string": "movie", + "type": "string" + } + }, + "tag": { + "$ref": "#/definitions/commons.types.Tag" + }, + "book": { + "type": "string" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "revenue": { + "type": "integer" + } + }, + "required": [ + "id", + "title", + "from", + "rating", + "type", + "tag", + "metadata", + "revenue" + ], + "definitions": { + "types.MovieId": { + "type": "string" + }, + "commons.types.Tag": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MovieId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MovieId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:MovieId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Node.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Node.json new file mode 100644 index 00000000000..4bd1bb6f941 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Node.json @@ -0,0 +1,59 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + "trees": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + } + }, + "required": [ + "name" + ], + "definitions": { + "types.Tree": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + } + } + }, + "types.Node": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + "trees": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Request.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Request.json new file mode 100644 index 00000000000..645cf36c6f9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Request.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "request": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "request" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Response.json new file mode 100644 index 00000000000..c1579e4e93b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Response.json @@ -0,0 +1,71 @@ +{ + "type": "object", + "properties": { + "response": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + }, + "identifiers": { + "type": "array", + "items": { + "$ref": "#/definitions/Identifier" + } + } + }, + "required": [ + "response", + "identifiers" + ], + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "oneOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ] + }, + "Identifier": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "type", + "value", + "label" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ResponseType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ResponseType.json new file mode 100644 index 00000000000..63155d248c2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:ResponseType.json @@ -0,0 +1,38 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + } + }, + "required": [ + "type" + ], + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "oneOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:StuntDouble.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:StuntDouble.json new file mode 100644 index 00000000000..2a63ee6acc6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:StuntDouble.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "actorOrActressId": { + "type": "string" + } + }, + "required": [ + "name", + "actorOrActressId" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Test.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Test.json new file mode 100644 index 00000000000..27bc5dd91c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Test.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and", + "or" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "and" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "or" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Tree.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Tree.json new file mode 100644 index 00000000000..202ade184c0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types:Tree.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + } + }, + "definitions": { + "types.Tree": { + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + } + } + }, + "types.Node": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + "trees": { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_general-errors:BadObjectRequestInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_general-errors:BadObjectRequestInfo.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_general-errors:BadObjectRequestInfo.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/enum:WeatherReport.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/enum:WeatherReport.json new file mode 100644 index 00000000000..247b41d0eb2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/enum:WeatherReport.json @@ -0,0 +1,10 @@ +{ + "type": "string", + "enum": [ + "SUNNY", + "CLOUDY", + "RAINING", + "SNOWING" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:DoubleOptional.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:DoubleOptional.json new file mode 100644 index 00000000000..2eb1c999e63 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:DoubleOptional.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "optionalAlias": { + "$ref": "#/definitions/types.object.OptionalAlias" + } + }, + "definitions": { + "types.object.OptionalAlias": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithOptionalField.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithOptionalField.json new file mode 100644 index 00000000000..7d51a690ac6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithOptionalField.json @@ -0,0 +1,72 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "NestedObject": { + "$ref": "#/definitions/types.object.ObjectWithOptionalField" + } + }, + "definitions": { + "types.object.ObjectWithOptionalField": { + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "integer": { + "type": "integer" + }, + "long": { + "type": "integer" + }, + "double": { + "type": "number" + }, + "bool": { + "type": "boolean" + }, + "datetime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "base64": { + "type": "string", + "contentEncoding": "base64" + }, + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "set": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "map": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "bigint": { + "type": "string", + "pattern": "^-?[0-9]+$" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithRequiredField.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithRequiredField.json new file mode 100644 index 00000000000..246f26fabe7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:NestedObjectWithRequiredField.json @@ -0,0 +1,76 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "NestedObject": { + "$ref": "#/definitions/types.object.ObjectWithOptionalField" + } + }, + "required": [ + "string", + "NestedObject" + ], + "definitions": { + "types.object.ObjectWithOptionalField": { + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "integer": { + "type": "integer" + }, + "long": { + "type": "integer" + }, + "double": { + "type": "number" + }, + "bool": { + "type": "boolean" + }, + "datetime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "base64": { + "type": "string", + "contentEncoding": "base64" + }, + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "set": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "map": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "bigint": { + "type": "string", + "pattern": "^-?[0-9]+$" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithMapOfMap.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithMapOfMap.json new file mode 100644 index 00000000000..e7f67fb5a3a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithMapOfMap.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "map": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "required": [ + "map" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithOptionalField.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithOptionalField.json new file mode 100644 index 00000000000..abe3aa91ad9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithOptionalField.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "integer": { + "type": "integer" + }, + "long": { + "type": "integer" + }, + "double": { + "type": "number" + }, + "bool": { + "type": "boolean" + }, + "datetime": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date" + }, + "uuid": { + "type": "string", + "format": "uuid" + }, + "base64": { + "type": "string", + "contentEncoding": "base64" + }, + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "set": { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "map": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "bigint": { + "type": "string", + "pattern": "^-?[0-9]+$" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithRequiredField.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithRequiredField.json new file mode 100644 index 00000000000..5acf0a9d3ba --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:ObjectWithRequiredField.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + } + }, + "required": [ + "string" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:OptionalAlias.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:OptionalAlias.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object:OptionalAlias.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Animal.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Animal.json new file mode 100644 index 00000000000..cc516d61a85 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Animal.json @@ -0,0 +1,54 @@ +{ + "type": "object", + "properties": { + "animal": { + "type": "string", + "enum": [ + "dog", + "cat" + ] + } + }, + "required": [ + "animal" + ], + "oneOf": [ + { + "properties": { + "animal": { + "const": "dog" + }, + "name": { + "type": "string" + }, + "likesToWoof": { + "type": "boolean" + } + }, + "required": [ + "animal", + "name", + "likesToWoof" + ] + }, + { + "properties": { + "animal": { + "const": "cat" + }, + "name": { + "type": "string" + }, + "likesToMeow": { + "type": "boolean" + } + }, + "required": [ + "animal", + "name", + "likesToMeow" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Cat.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Cat.json new file mode 100644 index 00000000000..7bdeee85c10 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Cat.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "likesToMeow": { + "type": "boolean" + } + }, + "required": [ + "name", + "likesToMeow" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Dog.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Dog.json new file mode 100644 index 00000000000..3456fe728fa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union:Dog.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "likesToWoof": { + "type": "boolean" + } + }, + "required": [ + "name", + "likesToWoof" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:Docs.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:Docs.json new file mode 100644 index 00000000000..3819f58d284 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:Docs.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:ExampleType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:ExampleType.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:ExampleType.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:JSON.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:JSON.json new file mode 100644 index 00000000000..2fbe4ee0f37 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:JSON.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "raw": { + "type": "string" + } + }, + "required": [ + "raw" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:NestedType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:NestedType.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type_:NestedType.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_:Failure.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_:Failure.json new file mode 100644 index 00000000000..31e622999e5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_:Failure.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "status": { + "const": { + "string": "failure", + "type": "string" + } + } + }, + "required": [ + "status" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_user:User.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_user:User.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:Id.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:Id.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:Id.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:MyObject.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:MyObject.json new file mode 100644 index 00000000000..b6d40e2a46f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:MyObject.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:ObjectType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:ObjectType.json new file mode 100644 index 00000000000..10ab8f94e43 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service:ObjectType.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "FOO", + "BAR" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/folders/type_a/d/types:Foo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/folders/type_a/d/types:Foo.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/folders/type_a/d/types:Foo.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/go-content-type/type_imdb:CreateMovieRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/go-content-type/type_imdb:CreateMovieRequest.json new file mode 100644 index 00000000000..228722e4433 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/go-content-type/type_imdb:CreateMovieRequest.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "title", + "rating" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Column.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Column.json new file mode 100644 index 00000000000..848d4b170df --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Column.json @@ -0,0 +1,84 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "id", + "values" + ], + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DeleteResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DeleteResponse.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DeleteResponse.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DescribeResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DescribeResponse.json new file mode 100644 index 00000000000..314f84a99bd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:DescribeResponse.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "namespaces": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/NamespaceSummary" + } + }, + "dimension": { + "type": "integer", + "minimum": 0 + }, + "fullness": { + "type": "number" + }, + "totalCount": { + "type": "integer", + "minimum": 0 + } + }, + "definitions": { + "NamespaceSummary": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:FetchResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:FetchResponse.json new file mode 100644 index 00000000000..417c3e9242a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:FetchResponse.json @@ -0,0 +1,110 @@ +{ + "type": "object", + "properties": { + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Column" + } + }, + "namespace": { + "type": "string" + }, + "usage": { + "$ref": "#/definitions/Usage" + } + }, + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + }, + "Column": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "id", + "values" + ] + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "type": "integer", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:IndexedData.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:IndexedData.json new file mode 100644 index 00000000000..c370d5988ac --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:IndexedData.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListElement.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListElement.json new file mode 100644 index 00000000000..d67789c267b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListElement.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListResponse.json new file mode 100644 index 00000000000..fafe54178df --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ListResponse.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "columns": { + "type": "array", + "items": { + "$ref": "#/definitions/ListElement" + } + }, + "pagination": { + "$ref": "#/definitions/Pagination" + }, + "namespace": { + "type": "string" + }, + "usage": { + "$ref": "#/definitions/Usage" + } + }, + "definitions": { + "ListElement": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "Pagination": { + "type": "object", + "properties": { + "next": { + "type": "string" + } + } + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "type": "integer", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Metadata.json new file mode 100644 index 00000000000..b3f4dc684ab --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Metadata.json @@ -0,0 +1,38 @@ +{ + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ], + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:MetadataValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:MetadataValue.json new file mode 100644 index 00000000000..2a08ce82749 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:MetadataValue.json @@ -0,0 +1,14 @@ +{ + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:NamespaceSummary.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:NamespaceSummary.json new file mode 100644 index 00000000000..519771c779f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:NamespaceSummary.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "count": { + "type": "integer", + "minimum": 0 + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Pagination.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Pagination.json new file mode 100644 index 00000000000..3e012679d48 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Pagination.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "next": { + "type": "string" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryColumn.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryColumn.json new file mode 100644 index 00000000000..bfeec842d6d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryColumn.json @@ -0,0 +1,87 @@ +{ + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "topK": { + "type": "integer", + "minimum": 0 + }, + "namespace": { + "type": "string" + }, + "filter": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "values" + ], + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResponse.json new file mode 100644 index 00000000000..5e33de908cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResponse.json @@ -0,0 +1,132 @@ +{ + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryResult" + } + }, + "matches": { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + "namespace": { + "type": "string" + }, + "usage": { + "$ref": "#/definitions/Usage" + } + }, + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + }, + "ScoredColumn": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "type": "number" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "id" + ] + }, + "QueryResult": { + "type": "object", + "properties": { + "matches": { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + "namespace": { + "type": "string" + } + } + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "type": "integer", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResult.json new file mode 100644 index 00000000000..b02e72ed310 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:QueryResult.json @@ -0,0 +1,100 @@ +{ + "type": "object", + "properties": { + "matches": { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + "namespace": { + "type": "string" + } + }, + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + }, + "ScoredColumn": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "type": "number" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ScoredColumn.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ScoredColumn.json new file mode 100644 index 00000000000..1eb1f497fe8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:ScoredColumn.json @@ -0,0 +1,86 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "type": "number" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "indexedData": { + "$ref": "#/definitions/IndexedData" + } + }, + "required": [ + "id" + ], + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "IndexedData": { + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UpdateResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UpdateResponse.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UpdateResponse.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UploadResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UploadResponse.json new file mode 100644 index 00000000000..519771c779f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:UploadResponse.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "count": { + "type": "integer", + "minimum": 0 + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Usage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Usage.json new file mode 100644 index 00000000000..3ae17ab72a8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type_:Usage.json @@ -0,0 +1,10 @@ +{ + "type": "object", + "properties": { + "units": { + "type": "integer", + "minimum": 0 + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:CreateResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:CreateResponse.json new file mode 100644 index 00000000000..aac860ad16a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:CreateResponse.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/UserModel" + } + }, + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "UserModel": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "weight": { + "type": "number" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:Metadata.json new file mode 100644 index 00000000000..b3f4dc684ab --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:Metadata.json @@ -0,0 +1,38 @@ +{ + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ], + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:MetadataValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:MetadataValue.json new file mode 100644 index 00000000000..2a08ce82749 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:MetadataValue.json @@ -0,0 +1,14 @@ +{ + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:UserModel.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:UserModel.json new file mode 100644 index 00000000000..1aacfbbe99a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type_:UserModel.json @@ -0,0 +1,59 @@ +{ + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "email": { + "type": "string" + }, + "age": { + "type": "integer", + "minimum": 0 + }, + "weight": { + "type": "number" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + } + }, + "definitions": { + "MetadataValue": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/idempotency-headers/type_payment:Currency.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/idempotency-headers/type_payment:Currency.json new file mode 100644 index 00000000000..f8dadbf18b3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/idempotency-headers/type_payment:Currency.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "USD", + "YEN" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:CreateMovieRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:CreateMovieRequest.json new file mode 100644 index 00000000000..228722e4433 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:CreateMovieRequest.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "title", + "rating" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:Movie.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:Movie.json new file mode 100644 index 00000000000..0ea8e9630d6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:Movie.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/imdb.MovieId" + }, + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "rating" + ], + "definitions": { + "imdb.MovieId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:MovieId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:MovieId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb:MovieId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_:SendResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_:SendResponse.json new file mode 100644 index 00000000000..0acc8fd28c3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_:SendResponse.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "success": { + "const": { + "boolean": true, + "type": "boolean" + } + } + }, + "required": [ + "message", + "status", + "success" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ANestedLiteral.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ANestedLiteral.json new file mode 100644 index 00000000000..a30c35ecb24 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ANestedLiteral.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "myLiteral": { + "const": { + "string": "How super cool", + "type": "string" + } + } + }, + "required": [ + "myLiteral" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ATopLevelLiteral.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ATopLevelLiteral.json new file mode 100644 index 00000000000..02f8e13eb4c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:ATopLevelLiteral.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "nestedLiteral": { + "$ref": "#/definitions/inlined.ANestedLiteral" + } + }, + "required": [ + "nestedLiteral" + ], + "definitions": { + "inlined.ANestedLiteral": { + "type": "object", + "properties": { + "myLiteral": { + "const": { + "string": "How super cool", + "type": "string" + } + } + }, + "required": [ + "myLiteral" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:SomeAliasedLiteral.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:SomeAliasedLiteral.json new file mode 100644 index 00000000000..33eaaa2bdca --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined:SomeAliasedLiteral.json @@ -0,0 +1,7 @@ +{ + "const": { + "string": "You're super wise", + "type": "string" + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:ContainerObject.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:ContainerObject.json new file mode 100644 index 00000000000..c8991573a8c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:ContainerObject.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "nestedObjects": { + "type": "array", + "items": { + "$ref": "#/definitions/reference.NestedObjectWithLiterals" + } + } + }, + "required": [ + "nestedObjects" + ], + "definitions": { + "reference.NestedObjectWithLiterals": { + "type": "object", + "properties": { + "literal1": { + "const": { + "string": "literal1", + "type": "string" + } + }, + "literal2": { + "const": { + "string": "literal2", + "type": "string" + } + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:NestedObjectWithLiterals.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:NestedObjectWithLiterals.json new file mode 100644 index 00000000000..512dd9490d2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:NestedObjectWithLiterals.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "literal1": { + "const": { + "string": "literal1", + "type": "string" + } + }, + "literal2": { + "const": { + "string": "literal2", + "type": "string" + } + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SendRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SendRequest.json new file mode 100644 index 00000000000..f36edb7500f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SendRequest.json @@ -0,0 +1,83 @@ +{ + "type": "object", + "properties": { + "prompt": { + "const": { + "string": "You are a helpful assistant", + "type": "string" + } + }, + "query": { + "type": "string" + }, + "stream": { + "const": { + "boolean": false, + "type": "boolean" + } + }, + "context": { + "$ref": "#/definitions/reference.SomeLiteral" + }, + "maybeContext": { + "$ref": "#/definitions/reference.SomeLiteral" + }, + "containerObject": { + "$ref": "#/definitions/reference.ContainerObject" + } + }, + "required": [ + "prompt", + "query", + "stream", + "context", + "containerObject" + ], + "definitions": { + "reference.SomeLiteral": { + "const": { + "string": "You're super wise", + "type": "string" + } + }, + "reference.NestedObjectWithLiterals": { + "type": "object", + "properties": { + "literal1": { + "const": { + "string": "literal1", + "type": "string" + } + }, + "literal2": { + "const": { + "string": "literal2", + "type": "string" + } + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ] + }, + "reference.ContainerObject": { + "type": "object", + "properties": { + "nestedObjects": { + "type": "array", + "items": { + "$ref": "#/definitions/reference.NestedObjectWithLiterals" + } + } + }, + "required": [ + "nestedObjects" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SomeLiteral.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SomeLiteral.json new file mode 100644 index 00000000000..33eaaa2bdca --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference:SomeLiteral.json @@ -0,0 +1,7 @@ +{ + "const": { + "string": "You're super wise", + "type": "string" + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:NestedUser.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:NestedUser.json new file mode 100644 index 00000000000..5d20f5512f6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:NestedUser.json @@ -0,0 +1,42 @@ +{ + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "NestedUser": { + "$ref": "#/definitions/service.User" + } + }, + "required": [ + "Name", + "NestedUser" + ], + "definitions": { + "service.User": { + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "metadata_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "EXTRA_PROPERTIES": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "userName", + "metadata_tags", + "EXTRA_PROPERTIES" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Organization.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Organization.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Organization.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Resource.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Resource.json new file mode 100644 index 00000000000..aa9731c5b27 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:Resource.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "resource_type": { + "type": "string", + "enum": [ + "user", + "Organization" + ] + } + }, + "required": [ + "resource_type" + ], + "oneOf": [ + { + "properties": { + "resource_type": { + "const": "user" + }, + "userName": { + "type": "string" + }, + "metadata_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "EXTRA_PROPERTIES": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "resource_type", + "userName", + "metadata_tags", + "EXTRA_PROPERTIES" + ] + }, + { + "properties": { + "resource_type": { + "const": "Organization" + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:ResourceStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:ResourceStatus.json new file mode 100644 index 00000000000..e4176609bdf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:ResourceStatus.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:User.json new file mode 100644 index 00000000000..31d56169787 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service:User.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "userName": { + "type": "string" + }, + "metadata_tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "EXTRA_PROPERTIES": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "userName", + "metadata_tags", + "EXTRA_PROPERTIES" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_:Id.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_:Id.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_:Id.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:CreateOrganizationRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:CreateOrganizationRequest.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:CreateOrganizationRequest.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:Organization.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:Organization.json new file mode 100644 index 00000000000..261071d7f71 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization:Organization.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "required": [ + "id", + "name", + "users" + ], + "definitions": { + "Id": { + "type": "string" + }, + "user.User": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "age": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "age" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events/metadata:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events/metadata:Metadata.json new file mode 100644 index 00000000000..56ca18535bc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events/metadata:Metadata.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "value": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "id", + "value" + ], + "definitions": { + "Id": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events:Event.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events:Event.json new file mode 100644 index 00000000000..34befd19273 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events:Event.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": { + "Id": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user:User.json new file mode 100644 index 00000000000..144788e814b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user:User.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "age": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "age" + ], + "definitions": { + "Id": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_:Operand.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_:Operand.json new file mode 100644 index 00000000000..daf62cdba2c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_:Operand.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + ">", + "=", + "less_than" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_user:User.json new file mode 100644 index 00000000000..7a77ec64771 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_user:User.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "age": { + "type": "integer" + } + }, + "required": [ + "id", + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-default/type_auth:TokenResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-default/type_auth:TokenResponse.json new file mode 100644 index 00000000000..ed496c7052d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-default/type_auth:TokenResponse.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-environment-variables/type_auth:TokenResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-environment-variables/type_auth:TokenResponse.json new file mode 100644 index 00000000000..9e24796eec8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-environment-variables/type_auth:TokenResponse.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "type": "string" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-nested-root/type_auth:TokenResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-nested-root/type_auth:TokenResponse.json new file mode 100644 index 00000000000..9e24796eec8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-nested-root/type_auth:TokenResponse.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "type": "string" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials/type_auth:TokenResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials/type_auth:TokenResponse.json new file mode 100644 index 00000000000..9e24796eec8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials/type_auth:TokenResponse.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "type": "string" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Name.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Name.json new file mode 100644 index 00000000000..21aea60672a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Name.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "id", + "value" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Type.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Type.json new file mode 100644 index 00000000000..face10c9261 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type_:Type.json @@ -0,0 +1,158 @@ +{ + "type": "object", + "properties": { + "one": { + "type": "integer" + }, + "two": { + "type": "number" + }, + "three": { + "type": "string" + }, + "four": { + "type": "boolean" + }, + "five": { + "type": "integer" + }, + "six": { + "type": "string", + "format": "date-time" + }, + "seven": { + "type": "string", + "format": "date" + }, + "eight": { + "type": "string", + "format": "uuid" + }, + "nine": { + "type": "string", + "contentEncoding": "base64" + }, + "ten": { + "type": "array", + "items": { + "type": "integer" + } + }, + "eleven": { + "type": "array", + "items": { + "type": "number" + }, + "uniqueItems": true + }, + "twelve": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + }, + "thirteen": { + "type": "integer" + }, + "fourteen": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + }, + "fifteen": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "sixteen": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + }, + "seventeen": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "eighteen": { + "const": { + "string": "eighteen", + "type": "string" + } + }, + "nineteen": { + "$ref": "#/definitions/Name" + }, + "twenty": { + "type": "integer", + "minimum": 0 + }, + "twentyone": { + "type": "integer", + "minimum": 0 + }, + "twentytwo": { + "type": "number" + }, + "twentythree": { + "type": "string", + "pattern": "^-?[0-9]+$" + } + }, + "required": [ + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "ten", + "eleven", + "twelve", + "fourteen", + "fifteen", + "sixteen", + "seventeen", + "eighteen", + "nineteen", + "twenty", + "twentyone", + "twentytwo", + "twentythree" + ], + "definitions": { + "Name": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "id", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Node.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Node.json new file mode 100644 index 00000000000..1f881e3e246 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Node.json @@ -0,0 +1,36 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/commons.metadata.Metadata" + } + }, + "required": [ + "id" + ], + "definitions": { + "commons.metadata.Metadata": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Tree.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Tree.json new file mode 100644 index 00000000000..90d6157b421 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_:Tree.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "nodes": { + "type": "array", + "items": { + "$ref": "#/definitions/Node" + } + } + }, + "definitions": { + "commons.metadata.Metadata": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + }, + "Node": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "type": "string" + }, + "metadata": { + "$ref": "#/definitions/commons.metadata.Metadata" + } + }, + "required": [ + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_commons/metadata:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_commons/metadata:Metadata.json new file mode 100644 index 00000000000..d433b7d8e36 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_commons/metadata:Metadata.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file/directory:Directory.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file/directory:Directory.json new file mode 100644 index 00000000000..0d37072cfbf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file/directory:Directory.json @@ -0,0 +1,74 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/file.File" + } + }, + "directories": { + "type": "array", + "items": { + "$ref": "#/definitions/file.directory.Directory" + } + } + }, + "required": [ + "name" + ], + "definitions": { + "file.FileInfo": { + "type": "string", + "enum": [ + "REGULAR", + "DIRECTORY" + ] + }, + "file.File": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/file.FileInfo" + } + }, + "required": [ + "name", + "contents", + "info" + ] + }, + "file.directory.Directory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/file.File" + } + }, + "directories": { + "type": "array", + "items": { + "$ref": "#/definitions/file.directory.Directory" + } + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:File.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:File.json new file mode 100644 index 00000000000..38a4b42238b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:File.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/file.FileInfo" + } + }, + "required": [ + "name", + "contents", + "info" + ], + "definitions": { + "file.FileInfo": { + "type": "string", + "enum": [ + "REGULAR", + "DIRECTORY" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:FileInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:FileInfo.json new file mode 100644 index 00000000000..7c51ee913ee --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file:FileInfo.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "REGULAR", + "DIRECTORY" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/package-yml/type_:EchoRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/package-yml/type_:EchoRequest.json new file mode 100644 index 00000000000..6bad2ca2017 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/package-yml/type_:EchoRequest.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "required": [ + "name", + "size" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernameCursor.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernameCursor.json new file mode 100644 index 00000000000..c90b8dacc5f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernameCursor.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "cursor": { + "$ref": "#/definitions/UsernamePage" + } + }, + "required": [ + "cursor" + ], + "definitions": { + "UsernamePage": { + "type": "object", + "properties": { + "after": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernamePage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernamePage.json new file mode 100644 index 00000000000..b135d469964 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_:UsernamePage.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "after": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedOptionalListResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedOptionalListResponse.json new file mode 100644 index 00000000000..c14d3f6835a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedOptionalListResponse.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "total_count": { + "type": "integer" + } + }, + "required": [ + "total_count" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedResponse.json new file mode 100644 index 00000000000..c14d3f6835a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersExtendedResponse.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "total_count": { + "type": "integer" + } + }, + "required": [ + "total_count" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersPaginationResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersPaginationResponse.json new file mode 100644 index 00000000000..81e20b9cc0b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:ListUsersPaginationResponse.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "hasNextPage": { + "type": "boolean" + }, + "page": { + "$ref": "#/definitions/users.Page" + }, + "total_count": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "total_count", + "data" + ], + "definitions": { + "users.NextPage": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ] + }, + "users.Page": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "next": { + "$ref": "#/definitions/users.NextPage" + }, + "per_page": { + "type": "integer" + }, + "total_page": { + "type": "integer" + } + }, + "required": [ + "page", + "per_page", + "total_page" + ] + }, + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:NextPage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:NextPage.json new file mode 100644 index 00000000000..bb76d40b1c3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:NextPage.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Order.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Order.json new file mode 100644 index 00000000000..d9d37bf6a06 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Order.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "asc", + "desc" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Page.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Page.json new file mode 100644 index 00000000000..c5e52e73a23 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:Page.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "next": { + "$ref": "#/definitions/users.NextPage" + }, + "per_page": { + "type": "integer" + }, + "total_page": { + "type": "integer" + } + }, + "required": [ + "page", + "per_page", + "total_page" + ], + "definitions": { + "users.NextPage": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:User.json new file mode 100644 index 00000000000..96ff6e3f27e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:User.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserListContainer.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserListContainer.json new file mode 100644 index 00000000000..79e8c265f71 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserListContainer.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "users" + ], + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListContainer.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListContainer.json new file mode 100644 index 00000000000..f030016b046 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListContainer.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListPage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListPage.json new file mode 100644 index 00000000000..15ccb8d4ab4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserOptionalListPage.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserOptionalListContainer" + }, + "next": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "data" + ], + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ] + }, + "users.UserOptionalListContainer": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserPage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserPage.json new file mode 100644 index 00000000000..b9126f462e4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UserPage.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserListContainer" + }, + "next": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "data" + ], + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ] + }, + "users.UserListContainer": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "users" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UsernameContainer.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UsernameContainer.json new file mode 100644 index 00000000000..481d69e5dfc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:UsernameContainer.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "results" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithCursor.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithCursor.json new file mode 100644 index 00000000000..bc084f28cda --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithCursor.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "cursor": { + "type": "string" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithPage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithPage.json new file mode 100644 index 00000000000..b194dc86918 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users:WithPage.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "page": { + "type": "integer" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:NestedUser.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:NestedUser.json new file mode 100644 index 00000000000..d515c6f291a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:NestedUser.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user.User" + } + }, + "required": [ + "name", + "user" + ], + "definitions": { + "user.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "tags" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:User.json new file mode 100644 index 00000000000..a62c2a8f442 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user:User.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "tags" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Package.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Package.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Package.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Record.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Record.json new file mode 100644 index 00000000000..ada84e05689 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package:Record.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "3d": { + "type": "integer" + } + }, + "required": [ + "foo", + "3d" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:OptionalStringResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:OptionalStringResponse.json new file mode 100644 index 00000000000..c67412e95cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:OptionalStringResponse.json @@ -0,0 +1,16 @@ +{ + "$ref": "#/definitions/StringResponse", + "definitions": { + "StringResponse": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + }, + "required": [ + "data" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:StringResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:StringResponse.json new file mode 100644 index 00000000000..2460c89ec11 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:StringResponse.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "data": { + "type": "string" + } + }, + "required": [ + "data" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:WithMetadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:WithMetadata.json new file mode 100644 index 00000000000..dc4a8b29d46 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_:WithMetadata.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "metadata" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Movie.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Movie.json new file mode 100644 index 00000000000..ad25119f9c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Movie.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:OptionalWithDocs.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:OptionalWithDocs.json new file mode 100644 index 00000000000..edc25321fdc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:OptionalWithDocs.json @@ -0,0 +1,16 @@ +{ + "$ref": "#/definitions/service.WithDocs", + "definitions": { + "service.WithDocs": { + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Response.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Response.json new file mode 100644 index 00000000000..fa16cca160d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:Response.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/service.Movie" + } + }, + "required": [ + "data" + ], + "definitions": { + "service.Movie": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:WithDocs.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:WithDocs.json new file mode 100644 index 00000000000..3819f58d284 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service:WithDocs.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-event-examples/type_completions:StreamedCompletion.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-event-examples/type_completions:StreamedCompletion.json new file mode 100644 index 00000000000..5c11132cb72 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-event-examples/type_completions:StreamedCompletion.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "delta": { + "type": "string" + }, + "tokens": { + "type": "integer" + } + }, + "required": [ + "delta" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events/type_completions:StreamedCompletion.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events/type_completions:StreamedCompletion.json new file mode 100644 index 00000000000..5c11132cb72 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events/type_completions:StreamedCompletion.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "delta": { + "type": "string" + }, + "tokens": { + "type": "integer" + } + }, + "required": [ + "delta" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Account.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Account.json new file mode 100644 index 00000000000..11eb35d0f9a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Account.json @@ -0,0 +1,87 @@ +{ + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Account", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "patient": { + "$ref": "#/definitions/Patient" + }, + "practitioner": { + "$ref": "#/definitions/Practitioner" + } + }, + "required": [ + "resource_type", + "name" + ], + "definitions": { + "Script": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Patient": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Patient", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "resource_type", + "name", + "scripts" + ] + }, + "Practitioner": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Practitioner", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:BaseResource.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:BaseResource.json new file mode 100644 index 00000000000..e0dac19cb67 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:BaseResource.json @@ -0,0 +1,139 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + } + }, + "required": [ + "id", + "related_resources", + "memo" + ], + "definitions": { + "Script": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Patient": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Patient", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "resource_type", + "name", + "scripts" + ] + }, + "Practitioner": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Practitioner", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Account": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Account", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "patient": { + "$ref": "#/definitions/Patient" + }, + "practitioner": { + "$ref": "#/definitions/Practitioner" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "ResourceList": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + }, + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "$ref": "#/definitions/Account" + } + }, + "required": [ + "description" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Memo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Memo.json new file mode 100644 index 00000000000..5a47064762d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Memo.json @@ -0,0 +1,101 @@ +{ + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "$ref": "#/definitions/Account" + } + }, + "required": [ + "description" + ], + "definitions": { + "Script": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Patient": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Patient", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "resource_type", + "name", + "scripts" + ] + }, + "Practitioner": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Practitioner", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Account": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Account", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "patient": { + "$ref": "#/definitions/Patient" + }, + "practitioner": { + "$ref": "#/definitions/Practitioner" + } + }, + "required": [ + "resource_type", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Patient.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Patient.json new file mode 100644 index 00000000000..78b18db9944 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Patient.json @@ -0,0 +1,45 @@ +{ + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Patient", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "resource_type", + "name", + "scripts" + ], + "definitions": { + "Script": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Practitioner.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Practitioner.json new file mode 100644 index 00000000000..f768317744f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Practitioner.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Practitioner", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:ResourceList.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:ResourceList.json new file mode 100644 index 00000000000..b1919d39374 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:ResourceList.json @@ -0,0 +1,103 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ], + "definitions": { + "Script": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Patient": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Patient", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "resource_type", + "name", + "scripts" + ] + }, + "Practitioner": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Practitioner", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ] + }, + "Account": { + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Account", + "type": "string" + } + }, + "name": { + "type": "string" + }, + "patient": { + "$ref": "#/definitions/Patient" + }, + "practitioner": { + "$ref": "#/definitions/Practitioner" + } + }, + "required": [ + "resource_type", + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Script.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Script.json new file mode 100644 index 00000000000..4f487402255 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type_:Script.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "resource_type": { + "const": { + "string": "Script", + "type": "string" + } + }, + "name": { + "type": "string" + } + }, + "required": [ + "resource_type", + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:RegularResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:RegularResponse.json new file mode 100644 index 00000000000..033695c8368 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:RegularResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:StreamResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:StreamResponse.json new file mode 100644 index 00000000000..033695c8368 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy:StreamResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming/type_dummy:StreamResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming/type_dummy:StreamResponse.json new file mode 100644 index 00000000000..033695c8368 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming/type_dummy:StreamResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_admin:Test.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_admin:Test.json new file mode 100644 index 00000000000..27bc5dd91c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_admin:Test.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "and", + "or" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "and" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "or" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeAndTreeValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeAndTreeValue.json new file mode 100644 index 00000000000..ce47d9c5653 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeAndTreeValue.json @@ -0,0 +1,58 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "nodeId", + "fullTree" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeValue.json new file mode 100644 index 00000000000..b7cbc8c43d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeNodeValue.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeValue.json new file mode 100644 index 00000000000..61bddb0d2d8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:BinaryTreeValue.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugKeyValuePairs.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugKeyValuePairs.json new file mode 100644 index 00000000000..72c100126a4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugKeyValuePairs.json @@ -0,0 +1,363 @@ +{ + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugMapValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugMapValue.json new file mode 100644 index 00000000000..3f67a399f6a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugMapValue.json @@ -0,0 +1,362 @@ +{ + "type": "object", + "properties": { + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "keyValuePairs" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugVariableValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugVariableValue.json new file mode 100644 index 00000000000..3623362be8e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DebugVariableValue.json @@ -0,0 +1,565 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeAndListValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeAndListValue.json new file mode 100644 index 00000000000..40461cf30b0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeAndListValue.json @@ -0,0 +1,58 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "nodeId", + "fullList" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeValue.json new file mode 100644 index 00000000000..4aa88d6cad8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListNodeValue.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListValue.json new file mode 100644 index 00000000000..c74c57b2eec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:DoublyLinkedListValue.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:FileInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:FileInfo.json new file mode 100644 index 00000000000..ca618a01815 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:FileInfo.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:GenericValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:GenericValue.json new file mode 100644 index 00000000000..9524d648468 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:GenericValue.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "stringifiedValue" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:KeyValuePair.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:KeyValuePair.json new file mode 100644 index 00000000000..1f6f32ed645 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:KeyValuePair.json @@ -0,0 +1,289 @@ +{ + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:Language.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:Language.json new file mode 100644 index 00000000000..ed63fce0622 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:Language.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ListType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ListType.json new file mode 100644 index 00000000000..70830231af5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ListType.json @@ -0,0 +1,156 @@ +{ + "type": "object", + "properties": { + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "valueType" + ], + "definitions": { + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapType.json new file mode 100644 index 00000000000..0f2b7b81fca --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapType.json @@ -0,0 +1,157 @@ +{ + "type": "object", + "properties": { + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "keyType", + "valueType" + ], + "definitions": { + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapValue.json new file mode 100644 index 00000000000..a1bd8b2dcae --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:MapValue.json @@ -0,0 +1,288 @@ +{ + "type": "object", + "properties": { + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "keyValuePairs" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:NodeId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:NodeId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:NodeId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ProblemId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ProblemId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:ProblemId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeAndListValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeAndListValue.json new file mode 100644 index 00000000000..6148acdaa20 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeAndListValue.json @@ -0,0 +1,55 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "nodeId", + "fullList" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeValue.json new file mode 100644 index 00000000000..2f3a03b346c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListNodeValue.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListValue.json new file mode 100644 index 00000000000..d6360fab204 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:SinglyLinkedListValue.json @@ -0,0 +1,40 @@ +{ + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCase.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCase.json new file mode 100644 index 00000000000..14a11f9ba9b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCase.json @@ -0,0 +1,292 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCaseWithExpectedResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCaseWithExpectedResult.json new file mode 100644 index 00000000000..49bd5deb8ec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:TestCaseWithExpectedResult.json @@ -0,0 +1,307 @@ +{ + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:UserId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:UserId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:UserId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableType.json new file mode 100644 index 00000000000..ab2670172e3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableType.json @@ -0,0 +1,282 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableValue.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableValue.json new file mode 100644 index 00000000000..f32f9e3a0fc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons:VariableValue.json @@ -0,0 +1,468 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerRequest.json new file mode 100644 index 00000000000..645cf36c6f9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerRequest.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "request": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "request" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerResponse.json new file mode 100644 index 00000000000..32fbd049768 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server:LangServerResponse.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "response": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "response" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:Migration.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:Migration.json new file mode 100644 index 00000000000..287abc37d26 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:Migration.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/migration.MigrationStatus" + } + }, + "required": [ + "name", + "status" + ], + "definitions": { + "migration.MigrationStatus": { + "type": "string", + "enum": [ + "RUNNING", + "FAILED", + "FINISHED" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:MigrationStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:MigrationStatus.json new file mode 100644 index 00000000000..850d83b48b5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration:MigrationStatus.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "RUNNING", + "FAILED", + "FINISHED" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:Playlist.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:Playlist.json new file mode 100644 index 00000000000..b0455185142 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:Playlist.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "playlist_id": { + "$ref": "#/definitions/playlist.PlaylistId" + }, + "owner-id": { + "$ref": "#/definitions/commons.UserId" + } + }, + "required": [ + "playlist_id", + "owner-id" + ], + "definitions": { + "playlist.PlaylistId": { + "type": "string" + }, + "commons.UserId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistCreateRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistCreateRequest.json new file mode 100644 index 00000000000..f4e4a21702c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistCreateRequest.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "problems": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.ProblemId" + } + } + }, + "required": [ + "name", + "problems" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistIdNotFoundErrorBody.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistIdNotFoundErrorBody.json new file mode 100644 index 00000000000..079a753f86a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:PlaylistIdNotFoundErrorBody.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "playlistId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "playlistId" + }, + "value": { + "$ref": "#/definitions/playlist.PlaylistId" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "playlist.PlaylistId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:ReservedKeywordEnum.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:ReservedKeywordEnum.json new file mode 100644 index 00000000000..603d48b4b0c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:ReservedKeywordEnum.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "is", + "as" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:UpdatePlaylistRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:UpdatePlaylistRequest.json new file mode 100644 index 00000000000..f4e4a21702c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist:UpdatePlaylistRequest.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "problems": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.ProblemId" + } + } + }, + "required": [ + "name", + "problems" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemError.json new file mode 100644 index 00000000000..e841b16fc28 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemError.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "_type": { + "type": "string", + "enum": [ + "generic" + ] + } + }, + "required": [ + "_type" + ], + "oneOf": [ + { + "properties": { + "_type": { + "const": "generic" + }, + "message": { + "type": "string" + }, + "type": { + "type": "string" + }, + "stacktrace": { + "type": "string" + } + }, + "required": [ + "_type", + "message", + "type", + "stacktrace" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemRequest.json new file mode 100644 index 00000000000..17b5d413aa5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemRequest.json @@ -0,0 +1,610 @@ +{ + "type": "object", + "properties": { + "problemName": { + "type": "string" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/problem.ProblemFiles" + } + }, + "inputParams": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.VariableTypeAndName" + } + }, + "outputType": { + "$ref": "#/definitions/commons.VariableType" + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCaseWithExpectedResult" + } + }, + "methodName": { + "type": "string" + } + }, + "required": [ + "problemName", + "problemDescription", + "files", + "inputParams", + "outputType", + "testcases", + "methodName" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.VariableTypeAndName": { + "type": "object", + "properties": { + "variableType": { + "$ref": "#/definitions/commons.VariableType" + }, + "name": { + "type": "string" + } + }, + "required": [ + "variableType", + "name" + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + }, + "commons.TestCaseWithExpectedResult": { + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemResponse.json new file mode 100644 index 00000000000..f3a911ad727 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:CreateProblemResponse.json @@ -0,0 +1,86 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "success", + "error" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "success" + }, + "value": { + "$ref": "#/definitions/commons.ProblemId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "error" + }, + "value": { + "$ref": "#/definitions/problem.CreateProblemError" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "problem.CreateProblemError": { + "type": "object", + "properties": { + "_type": { + "type": "string", + "enum": [ + "generic" + ] + } + }, + "required": [ + "_type" + ], + "oneOf": [ + { + "properties": { + "_type": { + "const": "generic" + }, + "message": { + "type": "string" + }, + "type": { + "type": "string" + }, + "stacktrace": { + "type": "string" + } + }, + "required": [ + "_type", + "message", + "type", + "stacktrace" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GenericCreateProblemError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GenericCreateProblemError.json new file mode 100644 index 00000000000..1e0a68cc524 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GenericCreateProblemError.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + }, + "stacktrace": { + "type": "string" + } + }, + "required": [ + "message", + "type", + "stacktrace" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GetDefaultStarterFilesResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GetDefaultStarterFilesResponse.json new file mode 100644 index 00000000000..d3525b5146a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:GetDefaultStarterFilesResponse.json @@ -0,0 +1,49 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/problem.ProblemFiles" + } + } + }, + "required": [ + "files" + ], + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescription.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescription.json new file mode 100644 index 00000000000..e7e61af7da4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescription.json @@ -0,0 +1,345 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescriptionBoard.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescriptionBoard.json new file mode 100644 index 00000000000..221f9fdf318 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemDescriptionBoard.json @@ -0,0 +1,331 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemFiles.json new file mode 100644 index 00000000000..7fc72941bc6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemFiles.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ], + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemInfo.json new file mode 100644 index 00000000000..2c0786952c5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:ProblemInfo.json @@ -0,0 +1,625 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/problem.ProblemFiles" + } + }, + "inputParams": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.VariableTypeAndName" + } + }, + "outputType": { + "$ref": "#/definitions/commons.VariableType" + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCaseWithExpectedResult" + } + }, + "methodName": { + "type": "string" + }, + "supportsCustomTestCases": { + "type": "boolean" + } + }, + "required": [ + "problemId", + "problemDescription", + "problemName", + "problemVersion", + "files", + "inputParams", + "outputType", + "testcases", + "methodName", + "supportsCustomTestCases" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.VariableTypeAndName": { + "type": "object", + "properties": { + "variableType": { + "$ref": "#/definitions/commons.VariableType" + }, + "name": { + "type": "string" + } + }, + "required": [ + "variableType", + "name" + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + }, + "commons.TestCaseWithExpectedResult": { + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:UpdateProblemResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:UpdateProblemResponse.json new file mode 100644 index 00000000000..299a7f84f4a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:UpdateProblemResponse.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "problemVersion" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:VariableTypeAndName.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:VariableTypeAndName.json new file mode 100644 index 00000000000..16757b8b0ca --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem:VariableTypeAndName.json @@ -0,0 +1,157 @@ +{ + "type": "object", + "properties": { + "variableType": { + "$ref": "#/definitions/commons.VariableType" + }, + "name": { + "type": "string" + } + }, + "required": [ + "variableType", + "name" + ], + "definitions": { + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ActualResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ActualResult.json new file mode 100644 index 00000000000..2b20426ccaa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ActualResult.json @@ -0,0 +1,389 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:BuildingExecutorResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:BuildingExecutorResponse.json new file mode 100644 index 00000000000..bbe57734e2c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:BuildingExecutorResponse.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "submissionId", + "status" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CodeExecutionUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CodeExecutionUpdate.json new file mode 100644 index 00000000000..dc18834b7ea --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CodeExecutionUpdate.json @@ -0,0 +1,1086 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "buildingExecutor", + "running", + "errored", + "stopped", + "graded", + "gradedV2", + "workspaceRan", + "recording", + "recorded", + "invalidRequest", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "buildingExecutor" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "type", + "submissionId", + "status" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "state": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type", + "submissionId", + "state" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "errorInfo": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type", + "submissionId", + "errorInfo" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "graded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + } + } + }, + "required": [ + "type", + "submissionId", + "testCases" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + } + }, + "required": [ + "type", + "submissionId", + "testCases" + ] + }, + { + "properties": { + "type": { + "const": "workspaceRan" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "runDetails": { + "$ref": "#/definitions/submission.WorkspaceRunDetails" + } + }, + "required": [ + "type", + "submissionId", + "runDetails" + ] + }, + { + "properties": { + "type": { + "const": "recording" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCaseId": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "$ref": "#/definitions/submission.TracedFile" + } + }, + "required": [ + "type", + "submissionId", + "lineNumber", + "lightweightStackInfo" + ] + }, + { + "properties": { + "type": { + "const": "recorded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "invalidRequest" + }, + "request": { + "$ref": "#/definitions/submission.SubmissionRequest" + }, + "cause": { + "$ref": "#/definitions/submission.InvalidRequestCause" + } + }, + "required": [ + "type", + "request", + "cause" + ] + }, + { + "properties": { + "type": { + "const": "finished" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ] + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ] + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ] + }, + "commons.ProblemId": { + "type": "string" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + }, + "submission.SubmissionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "initializeProblemRequest", + "initializeWorkspaceRequest", + "submitV2", + "workspaceSubmit", + "stop" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "initializeProblemRequest" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "type", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "initializeWorkspaceRequest" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "submitV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "workspaceSubmit" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles" + ] + }, + { + "properties": { + "type": { + "const": "stop" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ] + }, + "submission.InvalidRequestCause": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "submissionIdNotFound", + "customTestCasesUnsupported", + "unexpectedLanguage" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "submissionIdNotFound" + }, + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "missingSubmissionId" + ] + }, + { + "properties": { + "type": { + "const": "customTestCasesUnsupported" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "problemId", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "unexpectedLanguage" + }, + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "type", + "expectedLanguage", + "actualLanguage" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CompileError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CompileError.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CompileError.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CustomTestCasesUnsupported.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CustomTestCasesUnsupported.json new file mode 100644 index 00000000000..5e733660240 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:CustomTestCasesUnsupported.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "problemId", + "submissionId" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErrorInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErrorInfo.json new file mode 100644 index 00000000000..effd2074c0d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErrorInfo.json @@ -0,0 +1,81 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ], + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErroredResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErroredResponse.json new file mode 100644 index 00000000000..2d576a0bc26 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ErroredResponse.json @@ -0,0 +1,100 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "errorInfo": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "submissionId", + "errorInfo" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionInfo.json new file mode 100644 index 00000000000..3ad4590f574 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionInfo.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionV2.json new file mode 100644 index 00000000000..66279ff901b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExceptionV2.json @@ -0,0 +1,50 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionResponse.json new file mode 100644 index 00000000000..eba0b9b632e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionResponse.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "sessionId": { + "type": "string" + }, + "executionSessionUrl": { + "type": "string" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "language", + "status" + ], + "definitions": { + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionState.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionState.json new file mode 100644 index 00000000000..bb817c59824 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionState.json @@ -0,0 +1,50 @@ +{ + "type": "object", + "properties": { + "lastTimeContacted": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "isWarmInstance": { + "type": "boolean" + }, + "awsTaskId": { + "type": "string" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "isWarmInstance", + "language", + "status" + ], + "definitions": { + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionStatus.json new file mode 100644 index 00000000000..0a7b531239e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExecutionSessionStatus.json @@ -0,0 +1,12 @@ +{ + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExistingSubmissionExecuting.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExistingSubmissionExecuting.json new file mode 100644 index 00000000000..78340671323 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExistingSubmissionExecuting.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExpressionLocation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExpressionLocation.json new file mode 100644 index 00000000000..bf22b344abb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ExpressionLocation.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:FinishedResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:FinishedResponse.json new file mode 100644 index 00000000000..78340671323 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:FinishedResponse.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetExecutionSessionStateResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetExecutionSessionStateResponse.json new file mode 100644 index 00000000000..55f86589afd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetExecutionSessionStateResponse.json @@ -0,0 +1,74 @@ +{ + "type": "object", + "properties": { + "states": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.ExecutionSessionState" + } + }, + "numWarmingInstances": { + "type": "integer" + }, + "warmingSessionIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "states", + "warmingSessionIds" + ], + "definitions": { + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + }, + "submission.ExecutionSessionState": { + "type": "object", + "properties": { + "lastTimeContacted": { + "type": "string" + }, + "sessionId": { + "type": "string" + }, + "isWarmInstance": { + "type": "boolean" + }, + "awsTaskId": { + "type": "string" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "isWarmInstance", + "language", + "status" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetSubmissionStateResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetSubmissionStateResponse.json new file mode 100644 index 00000000000..3231c717890 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetSubmissionStateResponse.json @@ -0,0 +1,916 @@ +{ + "type": "object", + "properties": { + "timeSubmitted": { + "type": "string", + "format": "date-time" + }, + "submission": { + "type": "string" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionTypeState": { + "$ref": "#/definitions/submission.SubmissionTypeState" + } + }, + "required": [ + "submission", + "language", + "submissionTypeState" + ], + "definitions": { + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.SubmissionStatusForTestCase": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "graded", + "gradedV2", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "graded" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "result", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "value": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "result", + "traceResponsesSize" + ] + } + ] + }, + "submission.TestSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "testCaseIdToState" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseIdToState" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.SubmissionStatusForTestCase" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.WorkspaceSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "ran", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + } + ] + }, + "submission.SubmissionTypeState": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "test", + "workspace" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "test" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "defaultTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "customTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "status": { + "$ref": "#/definitions/submission.TestSubmissionStatus" + } + }, + "required": [ + "type", + "problemId", + "defaultTestCases", + "customTestCases", + "status" + ] + }, + { + "properties": { + "type": { + "const": "workspace" + }, + "status": { + "$ref": "#/definitions/submission.WorkspaceSubmissionStatus" + } + }, + "required": [ + "type", + "status" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetTraceResponsesPageRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetTraceResponsesPageRequest.json new file mode 100644 index 00000000000..682214507e5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GetTraceResponsesPageRequest.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "offset": { + "type": "integer" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponse.json new file mode 100644 index 00000000000..ddb75ebf55a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponse.json @@ -0,0 +1,445 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + } + } + }, + "required": [ + "submissionId", + "testCases" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponseV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponseV2.json new file mode 100644 index 00000000000..3dcebee817c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedResponseV2.json @@ -0,0 +1,400 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + } + }, + "required": [ + "submissionId", + "testCases" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedTestCaseUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedTestCaseUpdate.json new file mode 100644 index 00000000000..37d8e8d4231 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:GradedTestCaseUpdate.json @@ -0,0 +1,396 @@ +{ + "type": "object", + "properties": { + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "testCaseId", + "grade" + ], + "definitions": { + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InitializeProblemRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InitializeProblemRequest.json new file mode 100644 index 00000000000..7f2fd0ebc86 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InitializeProblemRequest.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "problemId" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InternalError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InternalError.json new file mode 100644 index 00000000000..dee398eb58c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InternalError.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "properties": { + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "exceptionInfo" + ], + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestCause.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestCause.json new file mode 100644 index 00000000000..e39d1303c9b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestCause.json @@ -0,0 +1,85 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "submissionIdNotFound", + "customTestCasesUnsupported", + "unexpectedLanguage" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "submissionIdNotFound" + }, + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "missingSubmissionId" + ] + }, + { + "properties": { + "type": { + "const": "customTestCasesUnsupported" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "problemId", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "unexpectedLanguage" + }, + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "type", + "expectedLanguage", + "actualLanguage" + ] + } + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.ProblemId": { + "type": "string" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestResponse.json new file mode 100644 index 00000000000..eadc8dd39e0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:InvalidRequestResponse.json @@ -0,0 +1,243 @@ +{ + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/submission.SubmissionRequest" + }, + "cause": { + "$ref": "#/definitions/submission.InvalidRequestCause" + } + }, + "required": [ + "request", + "cause" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + }, + "submission.SubmissionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "initializeProblemRequest", + "initializeWorkspaceRequest", + "submitV2", + "workspaceSubmit", + "stop" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "initializeProblemRequest" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "type", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "initializeWorkspaceRequest" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "submitV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "workspaceSubmit" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles" + ] + }, + { + "properties": { + "type": { + "const": "stop" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ] + }, + "submission.InvalidRequestCause": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "submissionIdNotFound", + "customTestCasesUnsupported", + "unexpectedLanguage" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "submissionIdNotFound" + }, + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "missingSubmissionId" + ] + }, + { + "properties": { + "type": { + "const": "customTestCasesUnsupported" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "problemId", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "unexpectedLanguage" + }, + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "type", + "expectedLanguage", + "actualLanguage" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:LightweightStackframeInformation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:LightweightStackframeInformation.json new file mode 100644 index 00000000000..47ff7c0fde1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:LightweightStackframeInformation.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedResponseNotification.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedResponseNotification.json new file mode 100644 index 00000000000..fcf9c30101b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedResponseNotification.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "type": "string" + } + }, + "required": [ + "submissionId", + "traceResponsesSize" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedTestCaseUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedTestCaseUpdate.json new file mode 100644 index 00000000000..a6afc8cfd1e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordedTestCaseUpdate.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "testCaseId", + "traceResponsesSize" + ], + "definitions": { + "v2.problem.TestCaseId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordingResponseNotification.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordingResponseNotification.json new file mode 100644 index 00000000000..b04c5940f6f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RecordingResponseNotification.json @@ -0,0 +1,61 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCaseId": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "$ref": "#/definitions/submission.TracedFile" + } + }, + "required": [ + "submissionId", + "lineNumber", + "lightweightStackInfo" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ] + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningResponse.json new file mode 100644 index 00000000000..545faad615b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningResponse.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "state": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "submissionId", + "state" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningSubmissionState.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningSubmissionState.json new file mode 100644 index 00000000000..5d83f54654b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RunningSubmissionState.json @@ -0,0 +1,11 @@ +{ + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RuntimeError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RuntimeError.json new file mode 100644 index 00000000000..9b84ed9b419 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:RuntimeError.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:Scope.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:Scope.json new file mode 100644 index 00000000000..51ad710aaf6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:Scope.json @@ -0,0 +1,362 @@ +{ + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ShareId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ShareId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:ShareId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackFrame.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackFrame.json new file mode 100644 index 00000000000..1597a6b8296 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackFrame.json @@ -0,0 +1,384 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackInformation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackInformation.json new file mode 100644 index 00000000000..9c8722e5885 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StackInformation.json @@ -0,0 +1,398 @@ +{ + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "$ref": "#/definitions/submission.StackFrame" + } + }, + "required": [ + "numStackFrames" + ], + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StderrResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StderrResponse.json new file mode 100644 index 00000000000..5c027fe3ed6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StderrResponse.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "stderr": { + "type": "string" + } + }, + "required": [ + "submissionId", + "stderr" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StdoutResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StdoutResponse.json new file mode 100644 index 00000000000..d624264e854 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StdoutResponse.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "stdout" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StopRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StopRequest.json new file mode 100644 index 00000000000..78340671323 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StopRequest.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StoppedResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StoppedResponse.json new file mode 100644 index 00000000000..78340671323 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:StoppedResponse.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionFileInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionFileInfo.json new file mode 100644 index 00000000000..bf1c2e70816 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionFileInfo.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionId.json new file mode 100644 index 00000000000..f222a9da978 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionId.json @@ -0,0 +1,5 @@ +{ + "type": "string", + "format": "uuid", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionIdNotFound.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionIdNotFound.json new file mode 100644 index 00000000000..67517318ba2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionIdNotFound.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "missingSubmissionId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionRequest.json new file mode 100644 index 00000000000..7d798722a80 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionRequest.json @@ -0,0 +1,160 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "initializeProblemRequest", + "initializeWorkspaceRequest", + "submitV2", + "workspaceSubmit", + "stop" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "initializeProblemRequest" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "type", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "initializeWorkspaceRequest" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "submitV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "workspaceSubmit" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles" + ] + }, + { + "properties": { + "type": { + "const": "stop" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionResponse.json new file mode 100644 index 00000000000..a5f240d162a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionResponse.json @@ -0,0 +1,1185 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "serverInitialized", + "problemInitialized", + "workspaceInitialized", + "serverErrored", + "codeExecutionUpdate", + "terminated" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "serverInitialized" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "problemInitialized" + }, + "value": { + "$ref": "#/definitions/commons.ProblemId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "workspaceInitialized" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "serverErrored" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "codeExecutionUpdate" + }, + "value": { + "$ref": "#/definitions/submission.CodeExecutionUpdate" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "terminated" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.ExecutionSessionStatus": { + "type": "string", + "enum": [ + "CREATING_CONTAINER", + "PROVISIONING_CONTAINER", + "PENDING_CONTAINER", + "RUNNING_CONTAINER", + "LIVE_CONTAINER", + "FAILED_TO_LAUNCH" + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ] + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ] + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + }, + "submission.SubmissionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "initializeProblemRequest", + "initializeWorkspaceRequest", + "submitV2", + "workspaceSubmit", + "stop" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "initializeProblemRequest" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "type", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "initializeWorkspaceRequest" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "submitV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles", + "problemId" + ] + }, + { + "properties": { + "type": { + "const": "workspaceSubmit" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "language", + "submissionFiles" + ] + }, + { + "properties": { + "type": { + "const": "stop" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ] + }, + "submission.InvalidRequestCause": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "submissionIdNotFound", + "customTestCasesUnsupported", + "unexpectedLanguage" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "submissionIdNotFound" + }, + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "missingSubmissionId" + ] + }, + { + "properties": { + "type": { + "const": "customTestCasesUnsupported" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "problemId", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "unexpectedLanguage" + }, + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "type", + "expectedLanguage", + "actualLanguage" + ] + } + ] + }, + "submission.CodeExecutionUpdate": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "buildingExecutor", + "running", + "errored", + "stopped", + "graded", + "gradedV2", + "workspaceRan", + "recording", + "recorded", + "invalidRequest", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "buildingExecutor" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "type", + "submissionId", + "status" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "state": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type", + "submissionId", + "state" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "errorInfo": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type", + "submissionId", + "errorInfo" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + }, + { + "properties": { + "type": { + "const": "graded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + } + } + }, + "required": [ + "type", + "submissionId", + "testCases" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + } + }, + "required": [ + "type", + "submissionId", + "testCases" + ] + }, + { + "properties": { + "type": { + "const": "workspaceRan" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "runDetails": { + "$ref": "#/definitions/submission.WorkspaceRunDetails" + } + }, + "required": [ + "type", + "submissionId", + "runDetails" + ] + }, + { + "properties": { + "type": { + "const": "recording" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCaseId": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "$ref": "#/definitions/submission.TracedFile" + } + }, + "required": [ + "type", + "submissionId", + "lineNumber", + "lightweightStackInfo" + ] + }, + { + "properties": { + "type": { + "const": "recorded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "type": "string" + } + }, + "required": [ + "type", + "submissionId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "invalidRequest" + }, + "request": { + "$ref": "#/definitions/submission.SubmissionRequest" + }, + "cause": { + "$ref": "#/definitions/submission.InvalidRequestCause" + } + }, + "required": [ + "type", + "request", + "cause" + ] + }, + { + "properties": { + "type": { + "const": "finished" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "type", + "submissionId" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusForTestCase.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusForTestCase.json new file mode 100644 index 00000000000..58db133b782 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusForTestCase.json @@ -0,0 +1,545 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "graded", + "gradedV2", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "graded" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "result", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "value": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "result", + "traceResponsesSize" + ] + } + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusV2.json new file mode 100644 index 00000000000..f265a578969 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionStatusV2.json @@ -0,0 +1,1594 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "test", + "workspace" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "test" + }, + "updates": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TestSubmissionUpdate" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "problemInfo": { + "$ref": "#/definitions/v2.problem.ProblemInfoV2" + } + }, + "required": [ + "type", + "updates", + "problemId", + "problemVersion", + "problemInfo" + ] + }, + { + "properties": { + "type": { + "const": "workspace" + }, + "updates": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdate" + } + } + }, + "required": [ + "type", + "updates" + ] + } + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "stopped", + "errored", + "gradedTestCase", + "recordedTestCase", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "gradedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type", + "testCaseId", + "grade" + ] + }, + { + "properties": { + "type": { + "const": "recordedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "testCaseId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestSubmissionUpdate": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.TestSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ] + }, + "commons.ProblemId": { + "type": "string" + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.GeneratedFiles": { + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + }, + "v2.problem.ProblemInfoV2": { + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "customFiles": { + "$ref": "#/definitions/v2.problem.CustomFiles" + }, + "generatedFiles": { + "$ref": "#/definitions/v2.problem.GeneratedFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemId", + "problemDescription", + "problemName", + "problemVersion", + "supportedLanguages", + "customFiles", + "generatedFiles", + "customTestCaseTemplates", + "testcases", + "isPublic" + ] + }, + "submission.WorkspaceSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "ran", + "stopped", + "traced", + "tracedV2", + "errored", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "tracedV2" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.WorkspaceSubmissionUpdate": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeEnum.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeEnum.json new file mode 100644 index 00000000000..9c032be6ac1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeEnum.json @@ -0,0 +1,7 @@ +{ + "type": "string", + "enum": [ + "TEST" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeState.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeState.json new file mode 100644 index 00000000000..d76ccf134e7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmissionTypeState.json @@ -0,0 +1,885 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "test", + "workspace" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "test" + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "defaultTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "customTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "status": { + "$ref": "#/definitions/submission.TestSubmissionStatus" + } + }, + "required": [ + "type", + "problemId", + "defaultTestCases", + "customTestCases", + "status" + ] + }, + { + "properties": { + "type": { + "const": "workspace" + }, + "status": { + "$ref": "#/definitions/submission.WorkspaceSubmissionStatus" + } + }, + "required": [ + "type", + "status" + ] + } + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.SubmissionStatusForTestCase": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "graded", + "gradedV2", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "graded" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "result", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "value": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "result", + "traceResponsesSize" + ] + } + ] + }, + "submission.TestSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "testCaseIdToState" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseIdToState" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.SubmissionStatusForTestCase" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.WorkspaceSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "ran", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmitRequestV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmitRequestV2.json new file mode 100644 index 00000000000..ed0bd843396 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:SubmitRequestV2.json @@ -0,0 +1,68 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "submissionId", + "language", + "submissionFiles", + "problemId" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + }, + "commons.ProblemId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TerminatedResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TerminatedResponse.json new file mode 100644 index 00000000000..8c4b2642ca3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TerminatedResponse.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "properties": {}, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseGrade.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseGrade.json new file mode 100644 index 00000000000..d71ab451ec4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseGrade.json @@ -0,0 +1,378 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseHiddenGrade.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseHiddenGrade.json new file mode 100644 index 00000000000..5fa3d830d02 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseHiddenGrade.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "passed": { + "type": "boolean" + } + }, + "required": [ + "passed" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseNonHiddenGrade.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseNonHiddenGrade.json new file mode 100644 index 00000000000..1c671fa7a9a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseNonHiddenGrade.json @@ -0,0 +1,344 @@ +{ + "type": "object", + "properties": { + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "passed", + "stdout" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResult.json new file mode 100644 index 00000000000..c0573c9b453 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResult.json @@ -0,0 +1,408 @@ +{ + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResultWithStdout.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResultWithStdout.json new file mode 100644 index 00000000000..b06ecb7c6b6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestCaseResultWithStdout.json @@ -0,0 +1,423 @@ +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionState.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionState.json new file mode 100644 index 00000000000..b0a20eac986 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionState.json @@ -0,0 +1,755 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "defaultTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "customTestCases": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.TestCase" + } + }, + "status": { + "$ref": "#/definitions/submission.TestSubmissionStatus" + } + }, + "required": [ + "problemId", + "defaultTestCases", + "customTestCases", + "status" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.SubmissionStatusForTestCase": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "graded", + "gradedV2", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "graded" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "result", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "value": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "result", + "traceResponsesSize" + ] + } + ] + }, + "submission.TestSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "testCaseIdToState" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseIdToState" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.SubmissionStatusForTestCase" + } + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatus.json new file mode 100644 index 00000000000..7efe190d15b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatus.json @@ -0,0 +1,705 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "testCaseIdToState" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseIdToState" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.SubmissionStatusForTestCase" + } + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + }, + "submission.SubmissionStatusForTestCase": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "graded", + "gradedV2", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "graded" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "result", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "gradedV2" + }, + "value": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "result", + "traceResponsesSize" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatusV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatusV2.json new file mode 100644 index 00000000000..c0d82d471eb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionStatusV2.json @@ -0,0 +1,1429 @@ +{ + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TestSubmissionUpdate" + } + }, + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "type": "integer" + }, + "problemInfo": { + "$ref": "#/definitions/v2.problem.ProblemInfoV2" + } + }, + "required": [ + "updates", + "problemId", + "problemVersion", + "problemInfo" + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "stopped", + "errored", + "gradedTestCase", + "recordedTestCase", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "gradedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type", + "testCaseId", + "grade" + ] + }, + { + "properties": { + "type": { + "const": "recordedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "testCaseId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestSubmissionUpdate": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.TestSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ] + }, + "commons.ProblemId": { + "type": "string" + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.GeneratedFiles": { + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + }, + "v2.problem.ProblemInfoV2": { + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "customFiles": { + "$ref": "#/definitions/v2.problem.CustomFiles" + }, + "generatedFiles": { + "$ref": "#/definitions/v2.problem.GeneratedFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemId", + "problemDescription", + "problemName", + "problemVersion", + "supportedLanguages", + "customFiles", + "generatedFiles", + "customTestCaseTemplates", + "testcases", + "isPublic" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdate.json new file mode 100644 index 00000000000..d4014de34b8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdate.json @@ -0,0 +1,589 @@ +{ + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.TestSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "stopped", + "errored", + "gradedTestCase", + "recordedTestCase", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "gradedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type", + "testCaseId", + "grade" + ] + }, + { + "properties": { + "type": { + "const": "recordedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "testCaseId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdateInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdateInfo.json new file mode 100644 index 00000000000..11aed925d4a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TestSubmissionUpdateInfo.json @@ -0,0 +1,573 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "stopped", + "errored", + "gradedTestCase", + "recordedTestCase", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "gradedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "type", + "testCaseId", + "grade" + ] + }, + { + "properties": { + "type": { + "const": "recordedTestCase" + }, + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "testCaseId", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseGrade": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "hidden", + "nonHidden" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "hidden" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "type", + "passed" + ] + }, + { + "properties": { + "type": { + "const": "nonHidden" + }, + "passed": { + "type": "boolean" + }, + "actualResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponse.json new file mode 100644 index 00000000000..2536879c9bb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponse.json @@ -0,0 +1,445 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "returnValue": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "expressionLocation": { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "lineNumber", + "stack" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ] + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "$ref": "#/definitions/submission.StackFrame" + } + }, + "required": [ + "numStackFrames" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponseV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponseV2.json new file mode 100644 index 00000000000..ea1ac40af4d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponseV2.json @@ -0,0 +1,464 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "file": { + "$ref": "#/definitions/submission.TracedFile" + }, + "returnValue": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "expressionLocation": { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "lineNumber", + "file", + "stack" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ] + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "$ref": "#/definitions/submission.StackFrame" + } + }, + "required": [ + "numStackFrames" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPage.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPage.json new file mode 100644 index 00000000000..f587e23f2a3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPage.json @@ -0,0 +1,462 @@ +{ + "type": "object", + "properties": { + "offset": { + "type": "integer" + }, + "traceResponses": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TraceResponse" + } + } + }, + "required": [ + "traceResponses" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ] + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "$ref": "#/definitions/submission.StackFrame" + } + }, + "required": [ + "numStackFrames" + ] + }, + "submission.TraceResponse": { + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "returnValue": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "expressionLocation": { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "lineNumber", + "stack" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPageV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPageV2.json new file mode 100644 index 00000000000..1043e0e57be --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TraceResponsesPageV2.json @@ -0,0 +1,481 @@ +{ + "type": "object", + "properties": { + "offset": { + "type": "integer" + }, + "traceResponses": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TraceResponseV2" + } + } + }, + "required": [ + "traceResponses" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ] + }, + "commons.DebugVariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeNodeValue", + "singlyLinkedListNodeValue", + "doublyLinkedListNodeValue", + "undefinedValue", + "nullValue", + "genericValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "type", + "nodeId", + "fullTree" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListNodeValue" + }, + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "type", + "nodeId", + "fullList" + ] + }, + { + "properties": { + "type": { + "const": "undefinedValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "genericValue" + }, + "stringifiedType": { + "type": "string" + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ] + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ] + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "$ref": "#/definitions/submission.StackFrame" + } + }, + "required": [ + "numStackFrames" + ] + }, + "submission.TraceResponseV2": { + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "file": { + "$ref": "#/definitions/submission.TracedFile" + }, + "returnValue": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "expressionLocation": { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "lineNumber", + "file", + "stack" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedFile.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedFile.json new file mode 100644 index 00000000000..8e3880f65bd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedFile.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedTestCase.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedTestCase.json new file mode 100644 index 00000000000..a8defa12a10 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:TracedTestCase.json @@ -0,0 +1,438 @@ +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "result", + "traceResponsesSize" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ActualResult": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "exception", + "exceptionV2" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "exception" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "exceptionV2" + }, + "value": { + "$ref": "#/definitions/submission.ExceptionV2" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.TestCaseResult": { + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:UnexpectedLanguageError.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:UnexpectedLanguageError.json new file mode 100644 index 00000000000..be5bef89de6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:UnexpectedLanguageError.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "expectedLanguage", + "actualLanguage" + ], + "definitions": { + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceFiles.json new file mode 100644 index 00000000000..60c03b24030 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceFiles.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "properties": { + "mainFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "mainFile", + "readOnlyFiles" + ], + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRanResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRanResponse.json new file mode 100644 index 00000000000..f45756418a2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRanResponse.json @@ -0,0 +1,106 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "runDetails": { + "$ref": "#/definitions/submission.WorkspaceRunDetails" + } + }, + "required": [ + "submissionId", + "runDetails" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRunDetails.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRunDetails.json new file mode 100644 index 00000000000..4851038a19e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceRunDetails.json @@ -0,0 +1,87 @@ +{ + "type": "object", + "properties": { + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ], + "definitions": { + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponse.json new file mode 100644 index 00000000000..0d68fedd81c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponse.json @@ -0,0 +1,49 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.WorkspaceFiles" + } + } + }, + "required": [ + "files" + ], + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ] + }, + "submission.WorkspaceFiles": { + "type": "object", + "properties": { + "mainFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "mainFile", + "readOnlyFiles" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponseV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponseV2.json new file mode 100644 index 00000000000..793ed0cec1b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceStarterFilesResponseV2.json @@ -0,0 +1,53 @@ +{ + "type": "object", + "properties": { + "filesByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "filesByLanguage" + ], + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionState.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionState.json new file mode 100644 index 00000000000..725ad468cf4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionState.json @@ -0,0 +1,247 @@ +{ + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/submission.WorkspaceSubmissionStatus" + } + }, + "required": [ + "status" + ], + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.WorkspaceSubmissionStatus": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "ran", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatus.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatus.json new file mode 100644 index 00000000000..db022fcc00b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatus.json @@ -0,0 +1,236 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "stopped", + "errored", + "running", + "ran", + "traced" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + } + ], + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatusV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatusV2.json new file mode 100644 index 00000000000..f5605cf77d6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionStatusV2.json @@ -0,0 +1,282 @@ +{ + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdate" + } + } + }, + "required": [ + "updates" + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.WorkspaceSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "ran", + "stopped", + "traced", + "tracedV2", + "errored", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "tracedV2" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.WorkspaceSubmissionUpdate": { + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdate.json new file mode 100644 index 00000000000..e2056951688 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdate.json @@ -0,0 +1,268 @@ +{ + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + }, + "submission.WorkspaceSubmissionUpdateInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "ran", + "stopped", + "traced", + "tracedV2", + "errored", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "tracedV2" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdateInfo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdateInfo.json new file mode 100644 index 00000000000..7a6afe95e0a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmissionUpdateInfo.json @@ -0,0 +1,252 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "running", + "ran", + "stopped", + "traced", + "tracedV2", + "errored", + "finished" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "running" + }, + "value": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "ran" + }, + "exceptionV2": { + "$ref": "#/definitions/submission.ExceptionV2" + }, + "exception": { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "stopped" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "traced" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "tracedV2" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "type", + "traceResponsesSize" + ] + }, + { + "properties": { + "type": { + "const": "errored" + }, + "value": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "finished" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "submission.RunningSubmissionState": { + "type": "string", + "enum": [ + "QUEUEING_SUBMISSION", + "KILLING_HISTORICAL_SUBMISSIONS", + "WRITING_SUBMISSION_TO_FILE", + "COMPILING_SUBMISSION", + "RUNNING_SUBMISSION" + ] + }, + "submission.ExceptionV2": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "generic", + "timeout" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "generic" + }, + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "type", + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + { + "properties": { + "type": { + "const": "timeout" + } + }, + "required": [ + "type" + ] + } + ] + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ] + }, + "submission.ErrorInfo": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "compileError", + "runtimeError", + "internalError" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "compileError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "runtimeError" + }, + "message": { + "type": "string" + } + }, + "required": [ + "type", + "message" + ] + }, + { + "properties": { + "type": { + "const": "internalError" + }, + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "type", + "exceptionInfo" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmitRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmitRequest.json new file mode 100644 index 00000000000..9cef85dfb37 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceSubmitRequest.json @@ -0,0 +1,58 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "type": "string" + } + }, + "required": [ + "submissionId", + "language", + "submissionFiles" + ], + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "submission.SubmissionFileInfo": { + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceTracedUpdate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceTracedUpdate.json new file mode 100644 index 00000000000..c68ffedc4c7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission:WorkspaceTracedUpdate.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "traceResponsesSize" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:AssertCorrectnessCheck.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:AssertCorrectnessCheck.json new file mode 100644 index 00000000000..4bbda2fb13b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:AssertCorrectnessCheck.json @@ -0,0 +1,244 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicCustomFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicCustomFiles.json new file mode 100644 index 00000000000..78b7fec4255 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicCustomFiles.json @@ -0,0 +1,328 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicTestCaseTemplate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicTestCaseTemplate.json new file mode 100644 index 00000000000..86c658ba817 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:BasicTestCaseTemplate.json @@ -0,0 +1,88 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ], + "definitions": { + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CreateProblemRequestV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CreateProblemRequestV2.json new file mode 100644 index 00000000000..312c09a07ba --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CreateProblemRequestV2.json @@ -0,0 +1,1048 @@ +{ + "type": "object", + "properties": { + "problemName": { + "type": "string" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "customFiles": { + "$ref": "#/definitions/v2.problem.CustomFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemName", + "problemDescription", + "customFiles", + "customTestCaseTemplates", + "testcases", + "supportedLanguages", + "isPublic" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CustomFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CustomFiles.json new file mode 100644 index 00000000000..f71585537cb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:CustomFiles.json @@ -0,0 +1,364 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DeepEqualityCorrectnessCheck.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DeepEqualityCorrectnessCheck.json new file mode 100644 index 00000000000..43e14c3fb7c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DeepEqualityCorrectnessCheck.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "expectedValueParameterId" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DefaultProvidedFile.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DefaultProvidedFile.json new file mode 100644 index 00000000000..e58be2105b5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:DefaultProvidedFile.json @@ -0,0 +1,183 @@ +{ + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + }, + "relatedTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + } + } + }, + "required": [ + "file", + "relatedTypes" + ], + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FileInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FileInfoV2.json new file mode 100644 index 00000000000..0499d05d437 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FileInfoV2.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Files.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Files.json new file mode 100644 index 00000000000..3ae3ced0ae0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Files.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementation.json new file mode 100644 index 00000000000..3330a36e44b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementation.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementationForMultipleLanguages.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementationForMultipleLanguages.json new file mode 100644 index 00000000000..7db538e2ac5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionImplementationForMultipleLanguages.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "definitions": { + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionSignature.json new file mode 100644 index 00000000000..649b30b06ad --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:FunctionSignature.json @@ -0,0 +1,241 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "void", + "nonVoid", + "voidThatTakesActualResult" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "void" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + { + "properties": { + "type": { + "const": "nonVoid" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "returnType" + ] + }, + { + "properties": { + "type": { + "const": "voidThatTakesActualResult" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "actualResultType" + ] + } + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GeneratedFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GeneratedFiles.json new file mode 100644 index 00000000000..7cf0428b119 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GeneratedFiles.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ], + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileRequest.json new file mode 100644 index 00000000000..9ba89c4be14 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileRequest.json @@ -0,0 +1,197 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + } + }, + "required": [ + "methodName", + "signature" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileResponse.json new file mode 100644 index 00000000000..7f37d209c7e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetBasicSolutionFileResponse.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "solutionFileByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "solutionFileByLanguage" + ], + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureRequest.json new file mode 100644 index 00000000000..99ffcb5ab18 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureRequest.json @@ -0,0 +1,252 @@ +{ + "type": "object", + "properties": { + "functionSignature": { + "$ref": "#/definitions/v2.problem.FunctionSignature" + } + }, + "required": [ + "functionSignature" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.FunctionSignature": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "void", + "nonVoid", + "voidThatTakesActualResult" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "void" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + { + "properties": { + "type": { + "const": "nonVoid" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "returnType" + ] + }, + { + "properties": { + "type": { + "const": "voidThatTakesActualResult" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "actualResultType" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureResponse.json new file mode 100644 index 00000000000..1d9f07dceb5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetFunctionSignatureResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "functionByLanguage": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "functionByLanguage" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseFileRequest.json new file mode 100644 index 00000000000..d6fde1ec956 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseFileRequest.json @@ -0,0 +1,816 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + }, + "testCase": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "required": [ + "testCase" + ], + "definitions": { + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseTemplateFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseTemplateFileRequest.json new file mode 100644 index 00000000000..5fd4525dafb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:GetGeneratedTestCaseTemplateFileRequest.json @@ -0,0 +1,438 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "required": [ + "template" + ], + "definitions": { + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:LightweightProblemInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:LightweightProblemInfoV2.json new file mode 100644 index 00000000000..cc45d41f340 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:LightweightProblemInfoV2.json @@ -0,0 +1,172 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "variableTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + }, + "uniqueItems": true + } + }, + "required": [ + "problemId", + "problemName", + "problemVersion", + "variableTypes" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionDefinition.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionDefinition.json new file mode 100644 index 00000000000..efde25eff3f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionDefinition.json @@ -0,0 +1,225 @@ +{ + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionSignature.json new file mode 100644 index 00000000000..04d1d5a0fa0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:NonVoidFunctionSignature.json @@ -0,0 +1,182 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Parameter.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Parameter.json new file mode 100644 index 00000000000..1c308740253 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:Parameter.json @@ -0,0 +1,164 @@ +{ + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ParameterId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ParameterId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ParameterId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ProblemInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ProblemInfoV2.json new file mode 100644 index 00000000000..1066025b89d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:ProblemInfoV2.json @@ -0,0 +1,1091 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "customFiles": { + "$ref": "#/definitions/v2.problem.CustomFiles" + }, + "generatedFiles": { + "$ref": "#/definitions/v2.problem.GeneratedFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemId", + "problemDescription", + "problemName", + "problemVersion", + "supportedLanguages", + "customFiles", + "generatedFiles", + "customTestCaseTemplates", + "testcases", + "isPublic" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.GeneratedFiles": { + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.problem.TestCaseId": { + "type": "string" + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseExpects.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseExpects.json new file mode 100644 index 00000000000..699826d2c19 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseExpects.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseFunction.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseFunction.json new file mode 100644 index 00000000000..3daea83ef0f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseFunction.json @@ -0,0 +1,333 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementation.json new file mode 100644 index 00000000000..d36eb24dadc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementation.json @@ -0,0 +1,405 @@ +{ + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescription.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescription.json new file mode 100644 index 00000000000..24b82b31335 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescription.json @@ -0,0 +1,62 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescriptionBoard.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescriptionBoard.json new file mode 100644 index 00000000000..04645f2499b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationDescriptionBoard.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationReference.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationReference.json new file mode 100644 index 00000000000..7f54c71f72f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseImplementationReference.json @@ -0,0 +1,441 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ], + "definitions": { + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseMetadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseMetadata.json new file mode 100644 index 00000000000..5500641d133 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseMetadata.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "definitions": { + "v2.problem.TestCaseId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplate.json new file mode 100644 index 00000000000..f174cd5eb09 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplate.json @@ -0,0 +1,427 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ], + "definitions": { + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplateId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplateId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseTemplateId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseV2.json new file mode 100644 index 00000000000..07a41548d93 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseV2.json @@ -0,0 +1,768 @@ +{ + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "definitions": { + "v2.problem.TestCaseId": { + "type": "string" + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.problem.ParameterId": { + "type": "string" + }, + "v2.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseWithActualResultImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseWithActualResultImplementation.json new file mode 100644 index 00000000000..144ad3b703a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:TestCaseWithActualResultImplementation.json @@ -0,0 +1,292 @@ +{ + "type": "object", + "properties": { + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "getActualResult", + "assertCorrectnessCheck" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinition.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinition.json new file mode 100644 index 00000000000..76afefcefce --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinition.json @@ -0,0 +1,210 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "parameters", + "code" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinitionThatTakesActualResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinitionThatTakesActualResult.json new file mode 100644 index 00000000000..55cf45d2810 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionDefinitionThatTakesActualResult.json @@ -0,0 +1,210 @@ +{ + "type": "object", + "properties": { + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "additionalParameters", + "code" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignature.json new file mode 100644 index 00000000000..58095054681 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignature.json @@ -0,0 +1,178 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + } + }, + "required": [ + "parameters" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignatureThatTakesActualResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignatureThatTakesActualResult.json new file mode 100644 index 00000000000..30ca39810cb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem:VoidFunctionSignatureThatTakesActualResult.json @@ -0,0 +1,182 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "actualResultType" + ], + "definitions": { + "v2.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:AssertCorrectnessCheck.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:AssertCorrectnessCheck.json new file mode 100644 index 00000000000..68562bd9d56 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:AssertCorrectnessCheck.json @@ -0,0 +1,244 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicCustomFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicCustomFiles.json new file mode 100644 index 00000000000..ca508ad9bcd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicCustomFiles.json @@ -0,0 +1,328 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.v3.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.v3.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicTestCaseTemplate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicTestCaseTemplate.json new file mode 100644 index 00000000000..059a788804b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:BasicTestCaseTemplate.json @@ -0,0 +1,88 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ], + "definitions": { + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CreateProblemRequestV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CreateProblemRequestV2.json new file mode 100644 index 00000000000..fde77bf5b26 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CreateProblemRequestV2.json @@ -0,0 +1,1048 @@ +{ + "type": "object", + "properties": { + "problemName": { + "type": "string" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "customFiles": { + "$ref": "#/definitions/v2.v3.problem.CustomFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseV2" + } + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemName", + "problemDescription", + "customFiles", + "customTestCaseTemplates", + "testcases", + "supportedLanguages", + "isPublic" + ], + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.v3.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.v3.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.v3.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.v3.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.v3.problem.TestCaseId": { + "type": "string" + }, + "v2.v3.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.v3.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.v3.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.v3.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.v3.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CustomFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CustomFiles.json new file mode 100644 index 00000000000..64efec47d8b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:CustomFiles.json @@ -0,0 +1,364 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.v3.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.v3.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DeepEqualityCorrectnessCheck.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DeepEqualityCorrectnessCheck.json new file mode 100644 index 00000000000..f7b99da16e7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DeepEqualityCorrectnessCheck.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "expectedValueParameterId" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DefaultProvidedFile.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DefaultProvidedFile.json new file mode 100644 index 00000000000..abd9e16ab3d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:DefaultProvidedFile.json @@ -0,0 +1,183 @@ +{ + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + }, + "relatedTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + } + } + }, + "required": [ + "file", + "relatedTypes" + ], + "definitions": { + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FileInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FileInfoV2.json new file mode 100644 index 00000000000..0499d05d437 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FileInfoV2.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Files.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Files.json new file mode 100644 index 00000000000..57156d11f61 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Files.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "definitions": { + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementation.json new file mode 100644 index 00000000000..3330a36e44b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementation.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementationForMultipleLanguages.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementationForMultipleLanguages.json new file mode 100644 index 00000000000..f3ce67afdaf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionImplementationForMultipleLanguages.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "definitions": { + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionSignature.json new file mode 100644 index 00000000000..41a483fb8b4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:FunctionSignature.json @@ -0,0 +1,241 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "void", + "nonVoid", + "voidThatTakesActualResult" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "void" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + { + "properties": { + "type": { + "const": "nonVoid" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "returnType" + ] + }, + { + "properties": { + "type": { + "const": "voidThatTakesActualResult" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "actualResultType" + ] + } + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GeneratedFiles.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GeneratedFiles.json new file mode 100644 index 00000000000..423dd32b5a2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GeneratedFiles.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ], + "definitions": { + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileRequest.json new file mode 100644 index 00000000000..b46becb6b58 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileRequest.json @@ -0,0 +1,197 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + } + }, + "required": [ + "methodName", + "signature" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileResponse.json new file mode 100644 index 00000000000..c3ed42f71a8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetBasicSolutionFileResponse.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "solutionFileByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "solutionFileByLanguage" + ], + "definitions": { + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureRequest.json new file mode 100644 index 00000000000..1e1115063e5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureRequest.json @@ -0,0 +1,252 @@ +{ + "type": "object", + "properties": { + "functionSignature": { + "$ref": "#/definitions/v2.v3.problem.FunctionSignature" + } + }, + "required": [ + "functionSignature" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.FunctionSignature": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "void", + "nonVoid", + "voidThatTakesActualResult" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "void" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + { + "properties": { + "type": { + "const": "nonVoid" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "returnType" + ] + }, + { + "properties": { + "type": { + "const": "voidThatTakesActualResult" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "parameters", + "actualResultType" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureResponse.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureResponse.json new file mode 100644 index 00000000000..1d9f07dceb5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetFunctionSignatureResponse.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "properties": { + "functionByLanguage": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "functionByLanguage" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseFileRequest.json new file mode 100644 index 00000000000..b826feae357 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseFileRequest.json @@ -0,0 +1,816 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + }, + "testCase": { + "$ref": "#/definitions/v2.v3.problem.TestCaseV2" + } + }, + "required": [ + "testCase" + ], + "definitions": { + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.v3.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.v3.problem.TestCaseId": { + "type": "string" + }, + "v2.v3.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.v3.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.v3.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.v3.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseTemplateFileRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseTemplateFileRequest.json new file mode 100644 index 00000000000..d873eb971b1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:GetGeneratedTestCaseTemplateFileRequest.json @@ -0,0 +1,438 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + } + }, + "required": [ + "template" + ], + "definitions": { + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.v3.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:LightweightProblemInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:LightweightProblemInfoV2.json new file mode 100644 index 00000000000..cc45d41f340 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:LightweightProblemInfoV2.json @@ -0,0 +1,172 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "variableTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + }, + "uniqueItems": true + } + }, + "required": [ + "problemId", + "problemName", + "problemVersion", + "variableTypes" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionDefinition.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionDefinition.json new file mode 100644 index 00000000000..50c8433e5ea --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionDefinition.json @@ -0,0 +1,225 @@ +{ + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionSignature.json new file mode 100644 index 00000000000..4ab2863a580 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:NonVoidFunctionSignature.json @@ -0,0 +1,182 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Parameter.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Parameter.json new file mode 100644 index 00000000000..4c4305ac780 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:Parameter.json @@ -0,0 +1,164 @@ +{ + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ParameterId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ParameterId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ParameterId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ProblemInfoV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ProblemInfoV2.json new file mode 100644 index 00000000000..1ab625a5a94 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:ProblemInfoV2.json @@ -0,0 +1,1091 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemDescription": { + "$ref": "#/definitions/problem.ProblemDescription" + }, + "problemName": { + "type": "string" + }, + "problemVersion": { + "type": "integer" + }, + "supportedLanguages": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.Language" + }, + "uniqueItems": true + }, + "customFiles": { + "$ref": "#/definitions/v2.v3.problem.CustomFiles" + }, + "generatedFiles": { + "$ref": "#/definitions/v2.v3.problem.GeneratedFiles" + }, + "customTestCaseTemplates": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + } + }, + "testcases": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseV2" + } + }, + "isPublic": { + "type": "boolean" + } + }, + "required": [ + "problemId", + "problemDescription", + "problemName", + "problemVersion", + "supportedLanguages", + "customFiles", + "generatedFiles", + "customTestCaseTemplates", + "testcases", + "isPublic" + ], + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "variable", + "testCaseId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "variable" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "testCaseId" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ] + }, + "problem.ProblemDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.Language": { + "type": "string", + "enum": [ + "JAVA", + "JAVASCRIPT", + "PYTHON" + ] + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ] + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ] + }, + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "v2.v3.problem.BasicTestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "templateId", + "name", + "description", + "expectedValueParameterId" + ] + }, + "v2.v3.problem.CustomFiles": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "basic", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "basic" + }, + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "additionalFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "basicTestCaseTemplate": { + "$ref": "#/definitions/v2.v3.problem.BasicTestCaseTemplate" + } + }, + "required": [ + "type", + "methodName", + "signature", + "additionalFiles", + "basicTestCaseTemplate" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "value": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.GeneratedFiles": { + "type": "object", + "properties": { + "generatedTestCaseFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "generatedTemplateFiles": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + }, + "other": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.Files" + } + } + }, + "required": [ + "generatedTestCaseFiles", + "generatedTemplateFiles", + "other" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + }, + "v2.v3.problem.TestCaseTemplate": { + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ] + }, + "v2.v3.problem.TestCaseId": { + "type": "string" + }, + "v2.v3.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.v3.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "v2.v3.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + }, + "v2.v3.problem.TestCaseV2": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.v3.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseExpects.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseExpects.json new file mode 100644 index 00000000000..699826d2c19 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseExpects.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseFunction.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseFunction.json new file mode 100644 index 00000000000..c2fa83351cf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseFunction.json @@ -0,0 +1,333 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementation.json new file mode 100644 index 00000000000..db33c8d3aab --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementation.json @@ -0,0 +1,405 @@ +{ + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescription.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescription.json new file mode 100644 index 00000000000..d3af7d0d680 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescription.json @@ -0,0 +1,62 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescriptionBoard.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescriptionBoard.json new file mode 100644 index 00000000000..2a34999f9bc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationDescriptionBoard.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationReference.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationReference.json new file mode 100644 index 00000000000..805a52882ac --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseImplementationReference.json @@ -0,0 +1,441 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ], + "definitions": { + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseMetadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseMetadata.json new file mode 100644 index 00000000000..0019c3a1d71 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseMetadata.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "definitions": { + "v2.v3.problem.TestCaseId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplate.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplate.json new file mode 100644 index 00000000000..00ce5fa522c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplate.json @@ -0,0 +1,427 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ], + "definitions": { + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementation": { + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplateId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplateId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseTemplateId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseV2.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseV2.json new file mode 100644 index 00000000000..78d9f035bd7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseV2.json @@ -0,0 +1,768 @@ +{ + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.v3.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "definitions": { + "v2.v3.problem.TestCaseId": { + "type": "string" + }, + "v2.v3.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ] + }, + "v2.v3.problem.TestCaseTemplateId": { + "type": "string" + }, + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "v2.v3.problem.TestCaseImplementationDescriptionBoard": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "html", + "paramId" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "html" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "paramId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationDescription": { + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ] + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseFunction": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "withActualResult", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "withActualResult" + }, + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "type", + "getActualResult", + "assertCorrectnessCheck" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "parameters", + "code" + ] + } + ] + }, + "v2.v3.problem.TestCaseImplementationReference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "templateId", + "implementation" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "templateId" + }, + "value": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "implementation" + }, + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "type", + "description", + "function" + ] + } + ] + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ] + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "$ref": "#/definitions/commons.NodeId" + }, + "left": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "$ref": "#/definitions/commons.NodeId" + }, + "prev": { + "$ref": "#/definitions/commons.NodeId" + } + }, + "required": [ + "nodeId", + "val" + ] + }, + "commons.VariableValue": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerValue", + "booleanValue", + "doubleValue", + "stringValue", + "charValue", + "mapValue", + "listValue", + "binaryTreeValue", + "singlyLinkedListValue", + "doublyLinkedListValue", + "nullValue" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerValue" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanValue" + }, + "value": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleValue" + }, + "value": { + "type": "number" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charValue" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "mapValue" + }, + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "type", + "keyValuePairs" + ] + }, + { + "properties": { + "type": { + "const": "listValue" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeValue" + }, + "root": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "$ref": "#/definitions/commons.NodeId" + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseWithActualResultImplementation.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseWithActualResultImplementation.json new file mode 100644 index 00000000000..04a93322df3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:TestCaseWithActualResultImplementation.json @@ -0,0 +1,292 @@ +{ + "type": "object", + "properties": { + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "getActualResult", + "assertCorrectnessCheck" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ] + }, + "v2.v3.problem.AssertCorrectnessCheck": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "deepEquality", + "custom" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "deepEquality" + }, + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "type", + "expectedValueParameterId" + ] + }, + { + "properties": { + "type": { + "const": "custom" + }, + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "type", + "additionalParameters", + "code" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinition.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinition.json new file mode 100644 index 00000000000..1e2cc493881 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinition.json @@ -0,0 +1,210 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "parameters", + "code" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinitionThatTakesActualResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinitionThatTakesActualResult.json new file mode 100644 index 00000000000..2f5aa85cebf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionDefinitionThatTakesActualResult.json @@ -0,0 +1,210 @@ +{ + "type": "object", + "properties": { + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "additionalParameters", + "code" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "type": "string" + } + }, + "required": [ + "impl" + ] + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignature.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignature.json new file mode 100644 index 00000000000..9e70ec4ffe5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignature.json @@ -0,0 +1,178 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + } + }, + "required": [ + "parameters" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignatureThatTakesActualResult.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignatureThatTakesActualResult.json new file mode 100644 index 00000000000..cc330a5f934 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem:VoidFunctionSignatureThatTakesActualResult.json @@ -0,0 +1,182 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "actualResultType" + ], + "definitions": { + "v2.v3.problem.ParameterId": { + "type": "string" + }, + "commons.VariableType": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integerType", + "doubleType", + "booleanType", + "stringType", + "charType", + "listType", + "mapType", + "binaryTreeType", + "singlyLinkedListType", + "doublyLinkedListType" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integerType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doubleType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "booleanType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "stringType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "charType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "listType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "type": "boolean" + } + }, + "required": [ + "type", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "mapType" + }, + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "type", + "keyType", + "valueType" + ] + }, + { + "properties": { + "type": { + "const": "binaryTreeType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListType" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListType" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.v3.problem.Parameter": { + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:Movie.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:Movie.json new file mode 100644 index 00000000000..0ea8e9630d6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:Movie.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/imdb.MovieId" + }, + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "rating" + ], + "definitions": { + "imdb.MovieId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:MovieId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:MovieId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb:MovieId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Key.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Key.json new file mode 100644 index 00000000000..126ca20f3b3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Key.json @@ -0,0 +1,22 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/union.KeyType" + }, + { + "const": { + "string": "default", + "type": "string" + } + } + ], + "definitions": { + "union.KeyType": { + "type": "string", + "enum": [ + "name", + "value" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:KeyType.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:KeyType.json new file mode 100644 index 00000000000..28fa1df9000 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:KeyType.json @@ -0,0 +1,8 @@ +{ + "type": "string", + "enum": [ + "name", + "value" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Metadata.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Metadata.json new file mode 100644 index 00000000000..f89a5d86549 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:Metadata.json @@ -0,0 +1,7 @@ +{ + "type": "object", + "additionalProperties": { + "type": "string" + }, + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:MyUnion.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:MyUnion.json new file mode 100644 index 00000000000..622195bbe69 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:MyUnion.json @@ -0,0 +1,39 @@ +{ + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "integer" + }, + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:TypeWithOptionalUnion.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:TypeWithOptionalUnion.json new file mode 100644 index 00000000000..d16bd86f34b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union:TypeWithOptionalUnion.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "myUnion": { + "$ref": "#/definitions/union.MyUnion" + } + }, + "definitions": { + "union.MyUnion": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "integer" + }, + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + } + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Bar.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Bar.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Bar.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Foo.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Foo.json new file mode 100644 index 00000000000..c0a1798032d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Foo.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Union.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Union.json new file mode 100644 index 00000000000..b54618dd840 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:Union.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "foo" + }, + "value": { + "$ref": "#/definitions/types.Foo" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "bar" + }, + "value": { + "$ref": "#/definitions/types.Bar" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": { + "types.Foo": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "types.Bar": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithBaseProperties.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithBaseProperties.json new file mode 100644 index 00000000000..3ea11aee221 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithBaseProperties.json @@ -0,0 +1,59 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integer", + "string", + "foo" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "foo" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithDiscriminant.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithDiscriminant.json new file mode 100644 index 00000000000..d00d8d8080d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithDiscriminant.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "_type": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + }, + "required": [ + "_type" + ], + "oneOf": [ + { + "properties": { + "_type": { + "const": "foo" + }, + "value": { + "$ref": "#/definitions/types.Foo" + } + }, + "required": [ + "_type" + ] + }, + { + "properties": { + "_type": { + "const": "bar" + }, + "value": { + "$ref": "#/definitions/types.Bar" + } + }, + "required": [ + "_type" + ] + } + ], + "definitions": { + "types.Foo": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "types.Bar": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithLiteral.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithLiteral.json new file mode 100644 index 00000000000..4cb177757da --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithLiteral.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "fern" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "fern" + }, + "value": { + "const": { + "string": "fern", + "type": "string" + } + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithOptionalTime.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithOptionalTime.json new file mode 100644 index 00000000000..37b82efd6d3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithOptionalTime.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date", + "dateimte" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "date" + }, + "value": { + "type": "string", + "format": "date" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "dateimte" + }, + "value": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithPrimitive.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithPrimitive.json new file mode 100644 index 00000000000..5cbc80002cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithPrimitive.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "integer", + "string" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "integer" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithSingleElement.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithSingleElement.json new file mode 100644 index 00000000000..67da4fa9326 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithSingleElement.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "foo" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "foo" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithTime.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithTime.json new file mode 100644 index 00000000000..3aae80842c7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithTime.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "value", + "date", + "datetime" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "value" + }, + "value": { + "type": "integer" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "date" + }, + "value": { + "type": "string", + "format": "date" + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "datetime" + }, + "value": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithUnknown.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithUnknown.json new file mode 100644 index 00000000000..675fff01a67 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithUnknown.json @@ -0,0 +1,42 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "foo", + "unknown" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "foo" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + { + "properties": { + "type": { + "const": "unknown" + } + }, + "required": [ + "type" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithoutKey.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithoutKey.json new file mode 100644 index 00000000000..33e5aceae82 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types:UnionWithoutKey.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "foo", + "bar" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "foo" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + }, + { + "properties": { + "type": { + "const": "bar" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Circle.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Circle.json new file mode 100644 index 00000000000..763d396b754 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Circle.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "radius": { + "type": "number" + } + }, + "required": [ + "radius" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:GetShapeRequest.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:GetShapeRequest.json new file mode 100644 index 00000000000..a9bdf5a00c8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:GetShapeRequest.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Shape.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Shape.json new file mode 100644 index 00000000000..bac2863b83a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Shape.json @@ -0,0 +1,46 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "circle", + "square" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "circle" + }, + "radius": { + "type": "number" + } + }, + "required": [ + "type", + "radius" + ] + }, + { + "properties": { + "type": { + "const": "square" + }, + "length": { + "type": "number" + } + }, + "required": [ + "type", + "length" + ] + } + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Square.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Square.json new file mode 100644 index 00000000000..8cdd3703336 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union:Square.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "length": { + "type": "number" + } + }, + "required": [ + "length" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyAlias.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyAlias.json new file mode 100644 index 00000000000..7765de7e533 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyAlias.json @@ -0,0 +1,11 @@ +{ + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyObject.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyObject.json new file mode 100644 index 00000000000..c8a5cff1837 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown:MyObject.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "unknown": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "unknown" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Double.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Double.json new file mode 100644 index 00000000000..2d532df5239 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Double.json @@ -0,0 +1,4 @@ +{ + "type": "number", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:LargeInteger.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:LargeInteger.json new file mode 100644 index 00000000000..dc90325e791 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:LargeInteger.json @@ -0,0 +1,4 @@ +{ + "type": "integer", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Sentence.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Sentence.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Sentence.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Shape.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Shape.json new file mode 100644 index 00000000000..6b747b5af9d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Shape.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "SQUARE", + "CIRCLE", + "TRIANGLE" + ], + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:SmallInteger.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:SmallInteger.json new file mode 100644 index 00000000000..dc90325e791 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:SmallInteger.json @@ -0,0 +1,4 @@ +{ + "type": "integer", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Type.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Type.json new file mode 100644 index 00000000000..cfc8905ed36 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Type.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "decimal": { + "type": "number" + }, + "even": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "shape": { + "$ref": "#/definitions/Shape" + } + }, + "required": [ + "decimal", + "even", + "name", + "shape" + ], + "definitions": { + "Shape": { + "type": "string", + "enum": [ + "SQUARE", + "CIRCLE", + "TRIANGLE" + ] + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Word.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Word.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type_:Word.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:User.json new file mode 100644 index 00000000000..9b68f7737e8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:User.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/user.UserId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": { + "user.UserId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:UserId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:UserId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user:UserId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:User.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:User.json new file mode 100644 index 00000000000..9b68f7737e8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:User.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/user.UserId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "definitions": { + "user.UserId": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:UserId.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:UserId.json new file mode 100644 index 00000000000..cdb8c887b62 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user:UserId.json @@ -0,0 +1,4 @@ +{ + "type": "string", + "definitions": {} +} \ No newline at end of file diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/convertIRtoJsonSchema.test.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/convertIRtoJsonSchema.test.ts new file mode 100644 index 00000000000..59ad600cb68 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/convertIRtoJsonSchema.test.ts @@ -0,0 +1,58 @@ +import { describe, it, expect } from "vitest"; +import { convertIRtoJsonSchema } from "../convertIRtoJsonSchema"; +import { createMockTaskContext } from "@fern-api/task-context"; +import { loadApis } from "@fern-api/project-loader"; +import { AbsoluteFilePath, RelativeFilePath, join } from "@fern-api/fs-utils"; +import { generateIntermediateRepresentation } from "@fern-api/ir-generator"; + +describe("convertIRtoJsonSchema", async () => { + const TEST_DEFINITIONS_DIR = join( + AbsoluteFilePath.of(__dirname), + RelativeFilePath.of("../../../../../../test-definitions") + ); + const apiWorkspaces = await loadApis({ + fernDirectory: join(AbsoluteFilePath.of(TEST_DEFINITIONS_DIR), RelativeFilePath.of("fern")), + context: createMockTaskContext(), + cliVersion: "0.0.0", + cliName: "fern", + commandLineApiWorkspace: undefined, + defaultToAllApiWorkspaces: true + }); + + const context = createMockTaskContext(); + + await Promise.all( + apiWorkspaces.map(async (workspace) => { + const fernWorkspace = await workspace.toFernWorkspace({ + context + }); + + const intermediateRepresentation = await generateIntermediateRepresentation({ + workspace: fernWorkspace, + generationLanguage: undefined, + audiences: { type: "all" }, + keywords: undefined, + smartCasing: true, + disableExamples: false, + readme: undefined, + version: undefined, + packageName: undefined, + context + }); + + for (const [typeId, _] of Object.entries(intermediateRepresentation.types)) { + it(`${workspace.workspaceName}-${typeId}`, async () => { + const jsonschema = convertIRtoJsonSchema({ + ir: intermediateRepresentation, + typeId, + context + }); + + const json = JSON.stringify(jsonschema, undefined, 2); + // eslint-disable-next-line jest/no-standalone-expect + await expect(json).toMatchFileSnapshot(`./__snapshots__/${workspace.workspaceName}/${typeId}.json`); + }); + } + }) + ); +}); diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/convertIRtoJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/convertIRtoJsonSchema.ts new file mode 100644 index 00000000000..a15617db1a4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/convertIRtoJsonSchema.ts @@ -0,0 +1,27 @@ +import { IntermediateRepresentation, TypeDeclaration, TypeId } from "@fern-api/ir-sdk/"; +import { JSONSchema4 } from "json-schema"; +import { TaskContext } from "@fern-api/task-context"; +import { JsonSchemaConverterContext } from "./JsonSchemaConverterContext"; +import { convertTypeDeclarationToJsonSchema } from "./converters/convertTypeDeclarationToJsonSchema"; + +export declare namespace convertIRToJsonSchema { + interface Args { + ir: IntermediateRepresentation; + typeId: TypeId; + typeName?: string; + context: TaskContext; + } +} + +export function convertIRtoJsonSchema(args: convertIRToJsonSchema.Args): JSONSchema4 { + const context = new JsonSchemaConverterContext(args.context, args.ir); + const typeDeclaration = context.getTypeDeclarationForId({ typeId: args.typeId, typeName: args.typeName }); + const schema = convertTypeDeclarationToJsonSchema({ + typeDeclaration, + context + }); + return { + ...schema, + definitions: context.getDefinitions() + }; +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/containerToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/containerToJsonSchema.ts new file mode 100644 index 00000000000..56aa78a82dd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/containerToJsonSchema.ts @@ -0,0 +1,40 @@ +import { assertNever } from "@fern-api/core-utils"; +import { ContainerType } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { convertTypeReferenceToJsonSchema } from "./typeReferenceToJsonSchema"; + +export function convertContainerToJsonSchema({ + container, + context +}: { + container: ContainerType; + context: JsonSchemaConverterContext; +}): JSONSchema4 { + switch (container.type) { + case "list": + return { + type: "array", + items: convertTypeReferenceToJsonSchema({ typeReference: container.list, context }) + }; + case "map": + return { + type: "object", + additionalProperties: convertTypeReferenceToJsonSchema({ typeReference: container.valueType, context }) + }; + case "optional": + return convertTypeReferenceToJsonSchema({ typeReference: container.optional, context }); + case "set": + return { + type: "array", + items: convertTypeReferenceToJsonSchema({ typeReference: container.set, context }), + uniqueItems: true + }; + case "literal": + return { + const: container.literal + }; + default: + assertNever(container); + } +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/convertTypeDeclarationToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/convertTypeDeclarationToJsonSchema.ts new file mode 100644 index 00000000000..293307a342c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/convertTypeDeclarationToJsonSchema.ts @@ -0,0 +1,36 @@ +import { TypeDeclaration } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { convertObjectToJsonSchema } from "./objectToJsonSchema"; +import { convertEnumToJsonSchema } from "./enumToJsonSchema"; +import { convertUnionToJsonSchema } from "./unionToJsonSchema"; +import { convertUndiscriminatedUnionToJsonSchema } from "./undiscriminatedUnionToJsonSchema"; +import { convertTypeReferenceToJsonSchema } from "./typeReferenceToJsonSchema"; +import { assertNever } from "@fern-api/core-utils"; + +export declare namespace convertTypeDeclarationToJsonSchema { + interface Args { + typeDeclaration: TypeDeclaration; + context: JsonSchemaConverterContext; + } +} + +export function convertTypeDeclarationToJsonSchema({ + typeDeclaration, + context +}: convertTypeDeclarationToJsonSchema.Args): JSONSchema4 { + switch (typeDeclaration.shape.type) { + case "object": + return convertObjectToJsonSchema({ object: typeDeclaration.shape, context }); + case "alias": + return convertTypeReferenceToJsonSchema({ typeReference: typeDeclaration.shape.aliasOf, context }); + case "enum": + return convertEnumToJsonSchema({ enum: typeDeclaration.shape, context }); + case "union": + return convertUnionToJsonSchema({ union: typeDeclaration.shape, context }); + case "undiscriminatedUnion": + return convertUndiscriminatedUnionToJsonSchema({ undiscriminatedUnion: typeDeclaration.shape, context }); + default: + assertNever(typeDeclaration.shape); + } +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/enumToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/enumToJsonSchema.ts new file mode 100644 index 00000000000..4bbb4adc46d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/enumToJsonSchema.ts @@ -0,0 +1,17 @@ +import { EnumTypeDeclaration } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; + +export declare namespace convertEnumToJsonSchema { + interface Args { + enum: EnumTypeDeclaration; + context: JsonSchemaConverterContext; + } +} + +export function convertEnumToJsonSchema({ enum: enumDeclaration, context }: convertEnumToJsonSchema.Args): JSONSchema4 { + return { + type: "string", + enum: enumDeclaration.values.map((value) => value.name.wireValue) + }; +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/objectToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/objectToJsonSchema.ts new file mode 100644 index 00000000000..073c35bde43 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/objectToJsonSchema.ts @@ -0,0 +1,32 @@ +import { ObjectTypeDeclaration } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { convertTypeReferenceToJsonSchema } from "./typeReferenceToJsonSchema"; + +export declare namespace convertObjectToJsonSchema { + interface Args { + object: ObjectTypeDeclaration; + context: JsonSchemaConverterContext; + } +} + +export function convertObjectToJsonSchema({ object, context }: convertObjectToJsonSchema.Args): JSONSchema4 { + const properties = object.properties.map((property) => { + const propertyName = property.name.wireValue; + const propertySchema = convertTypeReferenceToJsonSchema({ + typeReference: property.valueType, + context + }); + return [propertyName, propertySchema]; + }); + + const requiredProperties = object.properties + .filter((property) => !context.isOptional(property.valueType)) + .map((property) => property.name.wireValue); + + return { + type: "object", + properties: Object.fromEntries(properties), + required: requiredProperties.length > 0 ? requiredProperties : undefined + }; +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/typeReferenceToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/typeReferenceToJsonSchema.ts new file mode 100644 index 00000000000..9f01d1570e0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/typeReferenceToJsonSchema.ts @@ -0,0 +1,125 @@ +import { PrimitiveTypeV1, TypeReference } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { assertNever } from "@fern-api/core-utils"; +import { convertContainerToJsonSchema } from "./containerToJsonSchema"; +import { convertTypeDeclarationToJsonSchema } from "./convertTypeDeclarationToJsonSchema"; + +export declare namespace convertTypeReferenceToJsonSchema { + interface Args { + typeReference: TypeReference; + context: JsonSchemaConverterContext; + } + + interface Response { + $ref: string; + definitions: Record; + } +} + +export function convertTypeReferenceToJsonSchema({ + typeReference, + context +}: convertTypeReferenceToJsonSchema.Args): JSONSchema4 { + switch (typeReference.type) { + case "named": { + const typeDeclaration = context.getTypeDeclarationForId({ typeId: typeReference.typeId }); + + // Check if the type hasn't been defined yet and isn't currently being built + // This prevents infinite recursion and ensures each type is only defined once + if ( + !context.hasDefinition(typeReference.typeId) && + !context.isBuildingTypeDeclaration(typeReference.typeId) + ) { + context.buildingTypeDeclaration(typeReference.typeId); + + const schema = convertTypeDeclarationToJsonSchema({ typeDeclaration, context }); + // Register the schema definition + context.registerDefinition(typeReference.typeId, schema); + + context.finishedBuildingTypeDeclaration(typeReference.typeId); + } + + // Return a reference to the schema in the definitions + return { + $ref: `#/definitions/${context.getDefinitionKey(typeDeclaration)}` + }; + } + case "container": + return convertContainerToJsonSchema({ container: typeReference.container, context }); + case "primitive": + return convertPrimitiveTypeReferenceToJsonSchema(typeReference.primitive.v1); + case "unknown": + return { + type: ["string", "number", "boolean", "object", "array", "null"] + }; + default: + assertNever(typeReference); + } +} + +function convertPrimitiveTypeReferenceToJsonSchema(primitive: PrimitiveTypeV1): JSONSchema4 { + switch (primitive) { + case PrimitiveTypeV1.String: + return { + type: "string" + }; + case PrimitiveTypeV1.Integer: + return { + type: "integer" + }; + case PrimitiveTypeV1.Long: + return { + type: "integer" + }; + case PrimitiveTypeV1.Uint: + return { + type: "integer", + minimum: 0 + }; + case PrimitiveTypeV1.Uint64: + return { + type: "integer", + minimum: 0 + }; + case PrimitiveTypeV1.Float: + return { + type: "number" + }; + case PrimitiveTypeV1.Double: + return { + type: "number" + }; + case PrimitiveTypeV1.Boolean: + return { + type: "boolean" + }; + case PrimitiveTypeV1.Date: + return { + type: "string", + format: "date" + }; + case PrimitiveTypeV1.DateTime: + return { + type: "string", + format: "date-time" + }; + case PrimitiveTypeV1.Uuid: + return { + type: "string", + format: "uuid" + }; + case PrimitiveTypeV1.Base64: + return { + type: "string", + contentEncoding: "base64" + }; + case PrimitiveTypeV1.BigInteger: + return { + type: "string", + pattern: "^-?[0-9]+$" + }; + default: + assertNever(primitive); + } +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/undiscriminatedUnionToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/undiscriminatedUnionToJsonSchema.ts new file mode 100644 index 00000000000..64d61dc31dd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/undiscriminatedUnionToJsonSchema.ts @@ -0,0 +1,29 @@ +import { UndiscriminatedUnionTypeDeclaration } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { convertTypeReferenceToJsonSchema } from "./typeReferenceToJsonSchema"; + +export declare namespace convertUndiscriminatedUnionToJsonSchema { + interface Args { + undiscriminatedUnion: UndiscriminatedUnionTypeDeclaration; + context: JsonSchemaConverterContext; + } +} + +export function convertUndiscriminatedUnionToJsonSchema({ + undiscriminatedUnion, + context +}: convertUndiscriminatedUnionToJsonSchema.Args): JSONSchema4 { + return { + oneOf: undiscriminatedUnion.members.map((member) => { + const jsonSchemaMember = convertTypeReferenceToJsonSchema({ + typeReference: member.type, + context + }); + if (member.docs) { + jsonSchemaMember.description = member.docs; + } + return jsonSchemaMember; + }) + }; +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/converters/unionToJsonSchema.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/unionToJsonSchema.ts new file mode 100644 index 00000000000..c682f6cc448 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/converters/unionToJsonSchema.ts @@ -0,0 +1,61 @@ +import { assertNever } from "@fern-api/core-utils"; +import { UnionTypeDeclaration } from "@fern-api/ir-sdk"; +import { JSONSchema4 } from "json-schema"; +import { JsonSchemaConverterContext } from "../JsonSchemaConverterContext"; +import { convertTypeDeclarationToJsonSchema } from "./convertTypeDeclarationToJsonSchema"; +import { convertTypeReferenceToJsonSchema } from "./typeReferenceToJsonSchema"; + +export declare namespace convertUnionToJsonSchema { + interface Args { + union: UnionTypeDeclaration; + context: JsonSchemaConverterContext; + } +} + +export function convertUnionToJsonSchema({ union, context }: convertUnionToJsonSchema.Args): JSONSchema4 { + const discriminant = union.discriminant.wireValue; + return { + type: "object", + properties: { + [discriminant]: { + type: "string", + enum: union.types.map((member) => member.discriminantValue.wireValue) + } + }, + required: [discriminant], + oneOf: union.types.map((member) => { + let properties: Record = {}; + let required: string[] = []; + switch (member.shape.propertiesType) { + case "samePropertiesAsObject": { + const typeDeclaration = context.getTypeDeclarationForId({ typeId: member.shape.typeId }); + const jsonSchema = convertTypeDeclarationToJsonSchema({ + typeDeclaration, + context + }); + properties = jsonSchema.properties ?? {}; + required = Array.isArray(jsonSchema.required) ? jsonSchema.required : []; + break; + } + case "singleProperty": + properties.value = convertTypeReferenceToJsonSchema({ + typeReference: member.shape.type, + context + }); + break; + case "noProperties": + // No additional properties or required fields + break; + default: + assertNever(member.shape); + } + return { + properties: { + [discriminant]: { const: member.discriminantValue.wireValue }, + ...properties + }, + required: [discriminant, ...required] + }; + }) + }; +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/src/index.ts b/packages/cli/fern-definition/ir-to-jsonschema/src/index.ts new file mode 100644 index 00000000000..98a71e9d74a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/index.ts @@ -0,0 +1 @@ +export { convertIRtoJsonSchema } from "./convertIRtoJsonSchema"; diff --git a/packages/cli/fern-definition/ir-to-jsonschema/tsconfig.json b/packages/cli/fern-definition/ir-to-jsonschema/tsconfig.json new file mode 100644 index 00000000000..7922dfd083f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../shared/tsconfig.shared.json", + "compilerOptions": { "composite": true, "outDir": "lib", "rootDir": "src" }, + "include": ["./src/**/*"], + "references": [ + { "path": "../../../commons/core-utils" }, + { "path": "../../../ir-sdk" }, + { "path": "../../task-context" }, + { "path": "../../../commons/fs-utils" }, + { "path": "../../workspace-loader" }, + { "path": "../../project-loader" }, + { "path": "../../generation/ir-generator" } + ] +} diff --git a/packages/cli/fern-definition/ir-to-jsonschema/vitest.config.ts b/packages/cli/fern-definition/ir-to-jsonschema/vitest.config.ts new file mode 100644 index 00000000000..d11017dc676 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/vitest.config.ts @@ -0,0 +1 @@ +export { default } from "../../../../shared/vitest.config"; diff --git a/packages/cli/fern-definition/schema/package.json b/packages/cli/fern-definition/schema/package.json index 90905ee2c12..1d7d782734f 100644 --- a/packages/cli/fern-definition/schema/package.json +++ b/packages/cli/fern-definition/schema/package.json @@ -34,7 +34,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/fern-definition/validator/package.json b/packages/cli/fern-definition/validator/package.json index 0e818279f25..e3acb1ef928 100644 --- a/packages/cli/fern-definition/validator/package.json +++ b/packages/cli/fern-definition/validator/package.json @@ -49,7 +49,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/generation/ir-generator/package.json b/packages/cli/generation/ir-generator/package.json index dd51c87a9c7..c2066396809 100644 --- a/packages/cli/generation/ir-generator/package.json +++ b/packages/cli/generation/ir-generator/package.json @@ -44,7 +44,7 @@ }, "devDependencies": { "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/object-hash": "^3.0.6", "@types/prettier": "^2.7.1", "@types/url-join": "4.0.1", diff --git a/packages/cli/generation/ir-generator/src/index.ts b/packages/cli/generation/ir-generator/src/index.ts index 16915271747..149d64595dc 100644 --- a/packages/cli/generation/ir-generator/src/index.ts +++ b/packages/cli/generation/ir-generator/src/index.ts @@ -33,3 +33,5 @@ export { export { getResolvedPathOfImportedFile } from "./utils/getResolvedPathOfImportedFile"; export { parseReferenceToEndpointName, type ReferenceToEndpointName } from "./utils/parseReferenceToEndpointName"; export { parseReferenceToTypeName, type ReferenceToTypeName } from "./utils/parseReferenceToTypeName"; +export { IdGenerator } from "./IdGenerator"; +export { convertToFernFilepath } from "./utils/convertToFernFilepath"; diff --git a/packages/cli/generation/ir-migrations/package.json b/packages/cli/generation/ir-migrations/package.json index 9d5a16e53b4..b5a3c28a63b 100644 --- a/packages/cli/generation/ir-migrations/package.json +++ b/packages/cli/generation/ir-migrations/package.json @@ -94,7 +94,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/generation/local-generation/docker-utils/package.json b/packages/cli/generation/local-generation/docker-utils/package.json index 8cd209c1e07..db35a666cab 100644 --- a/packages/cli/generation/local-generation/docker-utils/package.json +++ b/packages/cli/generation/local-generation/docker-utils/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/dockerode": "^3.3.9", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/generation/local-generation/local-workspace-runner/package.json b/packages/cli/generation/local-generation/local-workspace-runner/package.json index bed3022996e..fb6c2dbabe5 100644 --- a/packages/cli/generation/local-generation/local-workspace-runner/package.json +++ b/packages/cli/generation/local-generation/local-workspace-runner/package.json @@ -48,7 +48,7 @@ "devDependencies": { "@types/decompress": "^4.2.7", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/tmp": "^0.2.4", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/generation/remote-generation/remote-workspace-runner/package.json b/packages/cli/generation/remote-generation/remote-workspace-runner/package.json index 9e04e8b1c2b..6d3dc1cf0af 100644 --- a/packages/cli/generation/remote-generation/remote-workspace-runner/package.json +++ b/packages/cli/generation/remote-generation/remote-workspace-runner/package.json @@ -62,7 +62,7 @@ "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", "@types/mime-types": "^2.1.4", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/tar": "^6.1.11", "@types/terminal-link": "^1.2.0", "depcheck": "^1.4.6", diff --git a/packages/cli/init/package.json b/packages/cli/init/package.json index 4159db294a2..c7ce4ede26a 100644 --- a/packages/cli/init/package.json +++ b/packages/cli/init/package.json @@ -48,7 +48,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/lazy-fern-workspace/package.json b/packages/cli/lazy-fern-workspace/package.json index d90269538a0..b2c13d82937 100644 --- a/packages/cli/lazy-fern-workspace/package.json +++ b/packages/cli/lazy-fern-workspace/package.json @@ -58,7 +58,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/object-hash": "^3.0.6", "@types/tar": "^6.1.11", "depcheck": "^1.4.6", diff --git a/packages/cli/logger/package.json b/packages/cli/logger/package.json index b57766df71a..8f96f422d6e 100644 --- a/packages/cli/logger/package.json +++ b/packages/cli/logger/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/login/package.json b/packages/cli/login/package.json index 6711b85083b..3d02326d1f2 100644 --- a/packages/cli/login/package.json +++ b/packages/cli/login/package.json @@ -43,7 +43,7 @@ "@types/boxen": "^3.0.1", "@types/inquirer": "^9.0.7", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/qs": "6.9.15", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/mock/package.json b/packages/cli/mock/package.json index 5b300b8c3df..ab3e2273030 100644 --- a/packages/cli/mock/package.json +++ b/packages/cli/mock/package.json @@ -39,7 +39,7 @@ }, "devDependencies": { "@types/express": "^4.17.21", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/url-join": "4.0.1", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/posthog-manager/package.json b/packages/cli/posthog-manager/package.json index 9136c60b9a2..1faa33c11d7 100644 --- a/packages/cli/posthog-manager/package.json +++ b/packages/cli/posthog-manager/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/uuid": "^9.0.8", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/cli/project-loader/package.json b/packages/cli/project-loader/package.json index 5bc70eae191..71687c5332a 100644 --- a/packages/cli/project-loader/package.json +++ b/packages/cli/project-loader/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/register/package.json b/packages/cli/register/package.json index 9ea84e1eed1..0ce6e4cd23d 100644 --- a/packages/cli/register/package.json +++ b/packages/cli/register/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", @@ -52,4 +52,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/semver-utils/package.json b/packages/cli/semver-utils/package.json index abfa15226a1..8a35cf02696 100644 --- a/packages/cli/semver-utils/package.json +++ b/packages/cli/semver-utils/package.json @@ -33,7 +33,7 @@ "devDependencies": { "vitest": "^2.0.5", "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "organize-imports-cli": "^0.10.0", diff --git a/packages/cli/task-context/package.json b/packages/cli/task-context/package.json index dcd686c0a67..49c206ba35e 100644 --- a/packages/cli/task-context/package.json +++ b/packages/cli/task-context/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/cli/workspace-commons/package.json b/packages/cli/workspace-commons/package.json index 3f9981c83ca..50bf40956eb 100644 --- a/packages/cli/workspace-commons/package.json +++ b/packages/cli/workspace-commons/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/workspace-loader/package.json b/packages/cli/workspace-loader/package.json index cac929220d7..aa16f73b624 100644 --- a/packages/cli/workspace-loader/package.json +++ b/packages/cli/workspace-loader/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/cli/yaml/docs-validator/package.json b/packages/cli/yaml/docs-validator/package.json index 21ed72cdb0e..9795d36a15d 100644 --- a/packages/cli/yaml/docs-validator/package.json +++ b/packages/cli/yaml/docs-validator/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/commons/core-utils/package.json b/packages/commons/core-utils/package.json index e72175ede11..37d7e88e8a0 100644 --- a/packages/commons/core-utils/package.json +++ b/packages/commons/core-utils/package.json @@ -37,7 +37,7 @@ "@types/title": "^3.4.3", "@types/lodash-es": "^4.17.12", "@types/lodash": "^4.17.4", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/ua-parser-js": "^0.7.39", "@types/whatwg-mimetype": "^3.0.2", "depcheck": "^1.4.6", diff --git a/packages/commons/fs-utils/package.json b/packages/commons/fs-utils/package.json index 40fa31c0fbe..9fc0ee44f8c 100644 --- a/packages/commons/fs-utils/package.json +++ b/packages/commons/fs-utils/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/stream-json": "^1.7.7", "depcheck": "^1.4.6", "eslint": "^8.56.0", diff --git a/packages/commons/loadable/package.json b/packages/commons/loadable/package.json index 39e7f6790f1..360178e4d2b 100644 --- a/packages/commons/loadable/package.json +++ b/packages/commons/loadable/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/commons/logging-execa/package.json b/packages/commons/logging-execa/package.json index b3b03646b52..c154c05ff06 100644 --- a/packages/commons/logging-execa/package.json +++ b/packages/commons/logging-execa/package.json @@ -32,7 +32,7 @@ "tmp-promise": "^3.0.3" }, "devDependencies": { - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "globals": "link:@types/vitest/globals", diff --git a/packages/core/package.json b/packages/core/package.json index e25120a963f..cc6d78778be 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", @@ -44,4 +44,4 @@ "prettier": "^2.7.1", "typescript": "4.6.4" } -} +} \ No newline at end of file diff --git a/packages/ir-sdk/package.json b/packages/ir-sdk/package.json index 2471da01882..2a8ea832ef4 100644 --- a/packages/ir-sdk/package.json +++ b/packages/ir-sdk/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@types/jest": "^29.5.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "depcheck": "^1.4.6", "eslint": "^8.56.0", "vitest": "^2.0.5", diff --git a/packages/scripts/package.json b/packages/scripts/package.json index 5659c9cc156..e8e9acb3ca9 100644 --- a/packages/scripts/package.json +++ b/packages/scripts/package.json @@ -37,7 +37,7 @@ "@types/jest": "^29.5.12", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/yargs": "^17.0.28", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", "chalk": "^5.3.0", diff --git a/packages/seed/package.json b/packages/seed/package.json index f7bf99e1bd6..4c957a5e0fd 100644 --- a/packages/seed/package.json +++ b/packages/seed/package.json @@ -60,7 +60,7 @@ "@types/find-up": "^4.0.0", "@types/js-yaml": "^4.0.8", "@types/lodash-es": "^4.17.12", - "@types/node": "^18.7.18", + "@types/node": "18.7.18", "@types/semver": "^7.5.8", "@types/yargs": "^17.0.28", "@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 216fce88ae2..73ff82ea086 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,7 +54,7 @@ importers: specifier: ^4.17.6 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@typescript-eslint/eslint-plugin': specifier: ^5.27.1 @@ -181,7 +181,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -236,7 +236,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -275,7 +275,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -344,7 +344,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -407,7 +407,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -480,7 +480,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -519,7 +519,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -582,7 +582,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -642,7 +642,7 @@ importers: specifier: ^4.17.4 version: 4.17.4 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -681,7 +681,7 @@ importers: specifier: ^3.22.3 version: 3.22.4 - generators/pythonv2/codegen: + generators/python-v2/codegen: dependencies: '@fern-api/core-utils': specifier: workspace:* @@ -690,17 +690,14 @@ importers: specifier: workspace:* version: link:../../commons '@fern-fern/ir-sdk': - specifier: ^53.7.0 - version: 53.9.0 + specifier: 53.7.0 + version: 53.7.0 '@wasm-fmt/ruff_fmt': specifier: ^0.6.1 version: 0.6.1 devDependencies: - '@types/jest': - specifier: ^29.5.12 - version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -746,7 +743,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -795,7 +792,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -843,7 +840,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -909,7 +906,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -958,7 +955,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@yarnpkg/esbuild-plugin-pnp': specifier: ^3.0.0-rc.14 @@ -1000,7 +997,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1051,7 +1048,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/tmp': specifier: ^0.2.4 @@ -1112,7 +1109,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1155,7 +1152,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1201,7 +1198,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1238,7 +1235,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1281,7 +1278,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1330,7 +1327,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1373,7 +1370,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1458,7 +1455,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1498,7 +1495,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1541,7 +1538,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1581,7 +1578,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1624,7 +1621,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1670,7 +1667,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1713,7 +1710,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1756,7 +1753,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1802,7 +1799,7 @@ importers: version: 5.0.0 devDependencies: '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/node-fetch': specifier: 2.6.9 @@ -1886,7 +1883,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/tmp': specifier: ^0.2.4 @@ -1950,7 +1947,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -1996,7 +1993,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2036,7 +2033,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2157,7 +2154,7 @@ importers: specifier: ^0.5.9 version: 0.5.9 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/url-join': specifier: 4.0.1 @@ -2206,7 +2203,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2249,7 +2246,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2301,7 +2298,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2344,7 +2341,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2390,7 +2387,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2433,7 +2430,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2470,7 +2467,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2519,7 +2516,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2556,7 +2553,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2647,7 +2644,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/url-join': specifier: 4.0.1 @@ -2699,7 +2696,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2733,7 +2730,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2763,7 +2760,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2793,7 +2790,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2845,7 +2842,7 @@ importers: specifier: ^1.4.11 version: 1.4.11 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/node-fetch': specifier: 2.6.9 @@ -2905,7 +2902,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2941,7 +2938,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -2978,7 +2975,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3021,7 +3018,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3048,7 +3045,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3091,7 +3088,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3125,7 +3122,7 @@ importers: version: link:../../../workspace-loader devDependencies: '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3155,7 +3152,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3222,7 +3219,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/swagger2openapi': specifier: ^7.0.4 @@ -3286,7 +3283,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3326,7 +3323,7 @@ importers: version: link:../../../workspace-loader devDependencies: '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3381,7 +3378,7 @@ importers: specifier: ^9.0.6 version: 9.0.6 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3452,6 +3449,9 @@ importers: '@fern-api/ir-sdk': specifier: workspace:* version: link:../../ir-sdk + '@fern-api/ir-to-jsonschema': + specifier: workspace:* + version: link:../fern-definition/ir-to-jsonschema '@fern-api/lazy-fern-workspace': specifier: workspace:* version: link:../lazy-fern-workspace @@ -3534,7 +3534,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/tar': specifier: ^6.1.11 @@ -3673,7 +3673,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3749,7 +3749,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/semver': specifier: ^7.5.8 @@ -3798,7 +3798,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3850,7 +3850,7 @@ importers: version: 4.0.3 devDependencies: '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3905,7 +3905,7 @@ importers: specifier: ^5.2.1 version: 5.2.1 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -3996,7 +3996,7 @@ importers: specifier: ^4.17.21 version: 4.17.21 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/uuid': specifier: ^9.0.8 @@ -4081,7 +4081,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -4145,7 +4145,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/node-fetch': specifier: 2.6.9 @@ -4203,7 +4203,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/prettier': specifier: ^2.7.1 @@ -4230,6 +4230,55 @@ importers: specifier: ^2.0.5 version: 2.0.5(@types/node@18.7.18)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) + packages/cli/fern-definition/ir-to-jsonschema: + dependencies: + '@fern-api/core-utils': + specifier: workspace:* + version: link:../../../commons/core-utils + '@fern-api/fs-utils': + specifier: workspace:* + version: link:../../../commons/fs-utils + '@fern-api/ir-generator': + specifier: workspace:* + version: link:../../generation/ir-generator + '@fern-api/ir-sdk': + specifier: workspace:* + version: link:../../../ir-sdk + '@fern-api/project-loader': + specifier: workspace:* + version: link:../../project-loader + '@fern-api/task-context': + specifier: workspace:* + version: link:../../task-context + json-schema: + specifier: ^0.4.0 + version: 0.4.0 + devDependencies: + '@types/json-schema': + specifier: ^7.0.15 + version: 7.0.15 + '@types/node': + specifier: 18.7.18 + version: 18.7.18 + depcheck: + specifier: ^1.4.6 + version: 1.4.6 + eslint: + specifier: ^8.56.0 + version: 8.56.0 + organize-imports-cli: + specifier: ^0.10.0 + version: 0.10.0 + prettier: + specifier: ^2.7.1 + version: 2.7.1 + typescript: + specifier: 4.6.4 + version: 4.6.4 + vitest: + specifier: ^2.0.5 + version: 2.0.5(@types/node@18.7.18)(jsdom@20.0.3)(sass@1.72.0)(terser@5.31.5) + packages/cli/fern-definition/schema: dependencies: '@fern-api/core-utils': @@ -4246,7 +4295,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -4331,7 +4380,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -4401,7 +4450,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/object-hash': specifier: ^3.0.6 @@ -4627,7 +4676,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -4670,7 +4719,7 @@ importers: specifier: ^3.3.9 version: 3.3.9 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -4752,7 +4801,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/tmp': specifier: ^0.2.4 @@ -4876,7 +4925,7 @@ importers: specifier: ^2.1.4 version: 2.1.4 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/tar': specifier: ^6.1.11 @@ -4964,7 +5013,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5073,7 +5122,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/object-hash': specifier: ^3.0.6 @@ -5116,7 +5165,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5180,7 +5229,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/qs': specifier: 6.9.15 @@ -5235,7 +5284,7 @@ importers: specifier: ^4.17.21 version: 4.17.21 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/url-join': specifier: 4.0.1 @@ -5284,7 +5333,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/uuid': specifier: ^9.0.8 @@ -5333,7 +5382,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5397,7 +5446,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5431,7 +5480,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5462,7 +5511,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5511,7 +5560,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5584,7 +5633,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5678,7 +5727,7 @@ importers: specifier: ^4.0.8 version: 4.0.8 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5727,7 +5776,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/title': specifier: ^3.4.3 @@ -5782,7 +5831,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/stream-json': specifier: ^1.7.7 @@ -5816,7 +5865,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5850,7 +5899,7 @@ importers: version: 3.0.3 devDependencies: '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5896,7 +5945,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5923,7 +5972,7 @@ importers: specifier: ^29.5.12 version: 29.5.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 depcheck: specifier: ^1.4.6 @@ -5959,7 +6008,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/yargs': specifier: ^17.0.28 @@ -6070,7 +6119,7 @@ importers: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^18.7.18 + specifier: 18.7.18 version: 18.7.18 '@types/pretty-ms': specifier: ^5.0.1 @@ -10602,6 +10651,9 @@ packages: json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + json-schema@0.4.0: + resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==} + json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -18461,6 +18513,8 @@ snapshots: json-schema-traverse@1.0.0: {} + json-schema@0.4.0: {} + json-stable-stringify-without-jsonify@1.0.1: {} json-stream-stringify@3.1.4: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6191d2d1d3f..307bc281c89 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,4 +5,6 @@ packages: - "!packages/**/generated" - "generators/**" - "!generators/**/lib" - - "!generators/**/dist" \ No newline at end of file + - "!generators/**/dist" + - "!packages/cli/cli/dist/dev" + - "!packages/cli/cli/dist/prod" \ No newline at end of file