diff --git a/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap b/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap index 683d24adde4..9fb79fd50b5 100644 --- a/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/dependencies/__snapshots__/dependencies.test.ts.snap @@ -2,4 +2,4 @@ exports[`dependencies > correctly incorporates dependencies 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"dependent","camelCase":{"unsafeName":"dependent","safeName":"dependent"},"snakeCase":{"unsafeName":"dependent","safeName":"dependent"},"screamingSnakeCase":{"unsafeName":"DEPENDENT","safeName":"DEPENDENT"},"pascalCase":{"unsafeName":"Dependent","safeName":"Dependent"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_imported:RootString":{"inline":false,"name":{"name":{"originalName":"RootString","camelCase":{"unsafeName":"rootString","safeName":"rootString"},"snakeCase":{"unsafeName":"root_string","safeName":"root_string"},"screamingSnakeCase":{"unsafeName":"ROOT_STRING","safeName":"ROOT_STRING"},"pascalCase":{"unsafeName":"RootString","safeName":"RootString"}},"fernFilepath":{"allParts":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"packagePath":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"file":null},"typeId":"type_imported:RootString"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_y:IntegerAlias":{"inline":false,"name":{"name":{"originalName":"IntegerAlias","camelCase":{"unsafeName":"integerAlias","safeName":"integerAlias"},"snakeCase":{"unsafeName":"integer_alias","safeName":"integer_alias"},"screamingSnakeCase":{"unsafeName":"INTEGER_ALIAS","safeName":"INTEGER_ALIAS"},"pascalCase":{"unsafeName":"IntegerAlias","safeName":"IntegerAlias"}},"fernFilepath":{"allParts":[{"originalName":"y","camelCase":{"unsafeName":"y","safeName":"y"},"snakeCase":{"unsafeName":"y","safeName":"y"},"screamingSnakeCase":{"unsafeName":"Y","safeName":"Y"},"pascalCase":{"unsafeName":"Y","safeName":"Y"}}],"packagePath":[],"file":{"originalName":"y","camelCase":{"unsafeName":"y","safeName":"y"},"snakeCase":{"unsafeName":"y","safeName":"y"},"screamingSnakeCase":{"unsafeName":"Y","safeName":"Y"},"pascalCase":{"unsafeName":"Y","safeName":"Y"}}},"typeId":"type_y:IntegerAlias"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"INTEGER","v2":{"type":"integer","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_imported/x:StringAlias":{"inline":false,"name":{"name":{"originalName":"StringAlias","camelCase":{"unsafeName":"stringAlias","safeName":"stringAlias"},"snakeCase":{"unsafeName":"string_alias","safeName":"string_alias"},"screamingSnakeCase":{"unsafeName":"STRING_ALIAS","safeName":"STRING_ALIAS"},"pascalCase":{"unsafeName":"StringAlias","safeName":"StringAlias"}},"fernFilepath":{"allParts":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}},{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}],"packagePath":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"file":{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}},"typeId":"type_imported/x:StringAlias"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{"service_imported":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"packagePath":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"file":null}},"displayName":null,"basePath":{"head":"/","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_imported.rootEndpoint","name":{"originalName":"rootEndpoint","camelCase":{"unsafeName":"rootEndpoint","safeName":"rootEndpoint"},"snakeCase":{"unsafeName":"root_endpoint","safeName":"root_endpoint"},"screamingSnakeCase":{"unsafeName":"ROOT_ENDPOINT","safeName":"ROOT_ENDPOINT"},"pascalCase":{"unsafeName":"RootEndpoint","safeName":"RootEndpoint"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"GET","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":null,"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"0151c4f21dcb59ded0264beca4e001f6c9a6203a","url":"","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":null}},"docs":null}}],"pagination":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":["type_imported:RootString","type_y:IntegerAlias","type_imported/x:StringAlias"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"subpackages":{"subpackage_imported":{"name":{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}},"fernFilepath":{"allParts":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"packagePath":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"file":null},"service":"service_imported","types":["type_imported:RootString"],"errors":[],"subpackages":["subpackage_imported/x"],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null},"subpackage_y":{"name":{"originalName":"y","camelCase":{"unsafeName":"y","safeName":"y"},"snakeCase":{"unsafeName":"y","safeName":"y"},"screamingSnakeCase":{"unsafeName":"Y","safeName":"Y"},"pascalCase":{"unsafeName":"Y","safeName":"Y"}},"fernFilepath":{"allParts":[{"originalName":"y","camelCase":{"unsafeName":"y","safeName":"y"},"snakeCase":{"unsafeName":"y","safeName":"y"},"screamingSnakeCase":{"unsafeName":"Y","safeName":"Y"},"pascalCase":{"unsafeName":"Y","safeName":"Y"}}],"packagePath":[],"file":{"originalName":"y","camelCase":{"unsafeName":"y","safeName":"y"},"snakeCase":{"unsafeName":"y","safeName":"y"},"screamingSnakeCase":{"unsafeName":"Y","safeName":"Y"},"pascalCase":{"unsafeName":"Y","safeName":"Y"}}},"service":null,"types":["type_y:IntegerAlias"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null},"subpackage_imported/x":{"name":{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}},"fernFilepath":{"allParts":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}},{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}],"packagePath":[{"originalName":"imported","camelCase":{"unsafeName":"imported","safeName":"imported"},"snakeCase":{"unsafeName":"imported","safeName":"imported"},"screamingSnakeCase":{"unsafeName":"IMPORTED","safeName":"IMPORTED"},"pascalCase":{"unsafeName":"Imported","safeName":"Imported"}}],"file":{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}},"service":null,"types":["type_imported/x:StringAlias"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_imported","subpackage_y"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; -exports[`dependencies > file dependencies 1`] = `484515`; +exports[`dependencies > file dependencies 1`] = `559581`; diff --git a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap index 08f92b9c3c8..051ae2bc734 100644 --- a/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap +++ b/packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap @@ -12,7 +12,7 @@ exports[`ir > {"name":"multiple-environment-urls"} 1`] = `"{"fdrApiDefinitionId" exports[`ir > {"name":"navigation-points-to"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"my-api","camelCase":{"unsafeName":"myApi","safeName":"myApi"},"snakeCase":{"unsafeName":"my_api","safeName":"my_api"},"screamingSnakeCase":{"unsafeName":"MY_API","safeName":"MY_API"},"pascalCase":{"unsafeName":"MyApi","safeName":"MyApi"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{},"errors":{},"services":{},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":[]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"subpackages":{"subpackage_subpackage":{"name":{"originalName":"subpackage","camelCase":{"unsafeName":"subpackage","safeName":"subpackage"},"snakeCase":{"unsafeName":"subpackage","safeName":"subpackage"},"screamingSnakeCase":{"unsafeName":"SUBPACKAGE","safeName":"SUBPACKAGE"},"pascalCase":{"unsafeName":"Subpackage","safeName":"Subpackage"}},"fernFilepath":{"allParts":[{"originalName":"subpackage","camelCase":{"unsafeName":"subpackage","safeName":"subpackage"},"snakeCase":{"unsafeName":"subpackage","safeName":"subpackage"},"screamingSnakeCase":{"unsafeName":"SUBPACKAGE","safeName":"SUBPACKAGE"},"pascalCase":{"unsafeName":"Subpackage","safeName":"Subpackage"}}],"packagePath":[{"originalName":"subpackage","camelCase":{"unsafeName":"subpackage","safeName":"subpackage"},"snakeCase":{"unsafeName":"subpackage","safeName":"subpackage"},"screamingSnakeCase":{"unsafeName":"SUBPACKAGE","safeName":"SUBPACKAGE"},"pascalCase":{"unsafeName":"Subpackage","safeName":"Subpackage"}}],"file":null},"service":null,"types":[],"errors":[],"subpackages":["subpackage_subpackage/x"],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null},"subpackage_subpackage/x":{"name":{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}},"fernFilepath":{"allParts":[{"originalName":"subpackage","camelCase":{"unsafeName":"subpackage","safeName":"subpackage"},"snakeCase":{"unsafeName":"subpackage","safeName":"subpackage"},"screamingSnakeCase":{"unsafeName":"SUBPACKAGE","safeName":"SUBPACKAGE"},"pascalCase":{"unsafeName":"Subpackage","safeName":"Subpackage"}},{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}],"packagePath":[{"originalName":"subpackage","camelCase":{"unsafeName":"subpackage","safeName":"subpackage"},"snakeCase":{"unsafeName":"subpackage","safeName":"subpackage"},"screamingSnakeCase":{"unsafeName":"SUBPACKAGE","safeName":"SUBPACKAGE"},"pascalCase":{"unsafeName":"Subpackage","safeName":"Subpackage"}}],"file":{"originalName":"x","camelCase":{"unsafeName":"x","safeName":"x"},"snakeCase":{"unsafeName":"x","safeName":"x"},"screamingSnakeCase":{"unsafeName":"X","safeName":"X"},"pascalCase":{"unsafeName":"X","safeName":"X"}}},"service":null,"types":[],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_subpackage"],"webhooks":null,"navigationConfig":{"pointsTo":"subpackage_subpackage"},"hasEndpointsInTree":false,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; -exports[`ir > {"name":"nested-example-reference"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"api","camelCase":{"unsafeName":"api","safeName":"api"},"snakeCase":{"unsafeName":"api","safeName":"api"},"screamingSnakeCase":{"unsafeName":"API","safeName":"API"},"pascalCase":{"unsafeName":"Api","safeName":"Api"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[{"_type":"basic","username":{"originalName":"clientId","camelCase":{"unsafeName":"clientId","safeName":"clientId"},"snakeCase":{"unsafeName":"client_id","safeName":"client_id"},"screamingSnakeCase":{"unsafeName":"CLIENT_ID","safeName":"CLIENT_ID"},"pascalCase":{"unsafeName":"ClientId","safeName":"ClientId"}},"usernameEnvVar":null,"password":{"originalName":"clientSecret","camelCase":{"unsafeName":"clientSecret","safeName":"clientSecret"},"snakeCase":{"unsafeName":"client_secret","safeName":"client_secret"},"screamingSnakeCase":{"unsafeName":"CLIENT_SECRET","safeName":"CLIENT_SECRET"},"pascalCase":{"unsafeName":"ClientSecret","safeName":"ClientSecret"}},"passwordEnvVar":null,"docs":null}],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_nested:Response":{"inline":false,"name":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"valueType":{"_type":"container","container":{"_type":"optional","optional":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":["type_nested:Product"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_nested:Product":{"inline":false,"name":{"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"c","camelCase":{"unsafeName":"c","safeName":"c"},"snakeCase":{"unsafeName":"c","safeName":"c"},"screamingSnakeCase":{"unsafeName":"C","safeName":"C"},"pascalCase":{"unsafeName":"C","safeName":"C"}},"wireValue":"c"},"valueType":{"_type":"container","container":{"_type":"optional","optional":{"_type":"unknown"}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_nested:StringAlias":{"inline":false,"name":{"name":{"originalName":"StringAlias","camelCase":{"unsafeName":"stringAlias","safeName":"stringAlias"},"snakeCase":{"unsafeName":"string_alias","safeName":"string_alias"},"screamingSnakeCase":{"unsafeName":"STRING_ALIAS","safeName":"STRING_ALIAS"},"pascalCase":{"unsafeName":"StringAlias","safeName":"StringAlias"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:StringAlias"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"Example","camelCase":{"unsafeName":"example","safeName":"example"},"snakeCase":{"unsafeName":"example","safeName":"example"},"screamingSnakeCase":{"unsafeName":"EXAMPLE","safeName":"EXAMPLE"},"pascalCase":{"unsafeName":"Example","safeName":"Example"}},"shape":{"type":"alias","value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"hello"}}},"jsonExample":"hello"}},"jsonExample":"hello","docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{"service_nested":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}}},"displayName":null,"basePath":{"head":"/nested","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_nested.calculate","name":{"originalName":"calculate","camelCase":{"unsafeName":"calculate","safeName":"calculate"},"snakeCase":{"unsafeName":"calculate","safeName":"calculate"},"screamingSnakeCase":{"unsafeName":"CALCULATE","safeName":"CALCULATE"},"pascalCase":{"unsafeName":"Calculate","safeName":"Calculate"}},"displayName":null,"auth":true,"idempotent":false,"baseUrl":null,"method":"POST","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"/nested","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"named","name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response","default":null,"inline":null},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[{"example":{"id":"5a6f08f1a5b7c467c617c891b9b6e1f85c3cdaa17c9bc1a56012234eeb809937","name":null,"url":"/nested","rootPathParameters":[],"endpointPathParameters":[],"servicePathParameters":[],"endpointHeaders":[],"serviceHeaders":[],"queryParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","typeName":{"typeId":"type_nested:Response","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"container","container":{"type":"map","map":[{"key":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"b"}}},"jsonExample":"b"},"value":{"shape":{"type":"named","typeName":{"typeId":"type_nested:Product","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"c","camelCase":{"unsafeName":"c","safeName":"c"},"snakeCase":{"unsafeName":"c","safeName":"c"},"screamingSnakeCase":{"unsafeName":"C","safeName":"C"},"pascalCase":{"unsafeName":"C","safeName":"C"}},"wireValue":"c"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"unknown","unknown":{"d":{"e":"$11","f":"hello"}}},"jsonExample":{"d":{"e":"$11","f":"hello"}}},"valueType":{"_type":"unknown"}}},"jsonExample":{"d":{"e":"$11","f":"hello"}}},"originalTypeDeclaration":{"typeId":"type_nested:Product","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}}}}]}},"jsonExample":{"c":{"d":{"e":"$11","f":"hello"}}}}}],"keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}},"jsonExample":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}},"valueType":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}},"jsonExample":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}},"originalTypeDeclaration":{"typeId":"type_nested:Response","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}}}}]}},"jsonExample":{"a":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}}}}},"docs":null},"codeSamples":null}],"autogeneratedExamples":[{"example":{"id":"3e5209c114d643f245442ce29435eceebf84b02e","url":"/nested","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","shape":{"type":"object","properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"originalTypeDeclaration":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":null,"valueType":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}}}}]},"typeName":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"}},"jsonExample":{}}}},"docs":null}}],"pagination":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{"service_nested":["type_nested:Response"]},"sharedTypes":["type_nested:Product","type_nested:StringAlias"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"subpackages":{"subpackage_nested":{"name":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"service":"service_nested","types":["type_nested:Response","type_nested:Product","type_nested:StringAlias"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_nested"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":true,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; +exports[`ir > {"name":"nested-example-reference"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"api","camelCase":{"unsafeName":"api","safeName":"api"},"snakeCase":{"unsafeName":"api","safeName":"api"},"screamingSnakeCase":{"unsafeName":"API","safeName":"API"},"pascalCase":{"unsafeName":"Api","safeName":"Api"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[{"_type":"basic","username":{"originalName":"clientId","camelCase":{"unsafeName":"clientId","safeName":"clientId"},"snakeCase":{"unsafeName":"client_id","safeName":"client_id"},"screamingSnakeCase":{"unsafeName":"CLIENT_ID","safeName":"CLIENT_ID"},"pascalCase":{"unsafeName":"ClientId","safeName":"ClientId"}},"usernameEnvVar":null,"password":{"originalName":"clientSecret","camelCase":{"unsafeName":"clientSecret","safeName":"clientSecret"},"snakeCase":{"unsafeName":"client_secret","safeName":"client_secret"},"screamingSnakeCase":{"unsafeName":"CLIENT_SECRET","safeName":"CLIENT_SECRET"},"pascalCase":{"unsafeName":"ClientSecret","safeName":"ClientSecret"}},"passwordEnvVar":null,"docs":null}],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_nested:Response":{"inline":false,"name":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"valueType":{"_type":"container","container":{"_type":"optional","optional":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":["type_nested:Product"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_nested:Product":{"inline":false,"name":{"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"c","camelCase":{"unsafeName":"c","safeName":"c"},"snakeCase":{"unsafeName":"c","safeName":"c"},"screamingSnakeCase":{"unsafeName":"C","safeName":"C"},"pascalCase":{"unsafeName":"C","safeName":"C"}},"wireValue":"c"},"valueType":{"_type":"container","container":{"_type":"optional","optional":{"_type":"unknown"}}},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_nested:StringAlias":{"inline":false,"name":{"name":{"originalName":"StringAlias","camelCase":{"unsafeName":"stringAlias","safeName":"stringAlias"},"snakeCase":{"unsafeName":"string_alias","safeName":"string_alias"},"screamingSnakeCase":{"unsafeName":"STRING_ALIAS","safeName":"STRING_ALIAS"},"pascalCase":{"unsafeName":"StringAlias","safeName":"StringAlias"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:StringAlias"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[{"name":{"originalName":"Example","camelCase":{"unsafeName":"example","safeName":"example"},"snakeCase":{"unsafeName":"example","safeName":"example"},"screamingSnakeCase":{"unsafeName":"EXAMPLE","safeName":"EXAMPLE"},"pascalCase":{"unsafeName":"Example","safeName":"Example"}},"shape":{"type":"alias","value":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"hello"}}},"jsonExample":"hello"}},"jsonExample":"hello","docs":null}],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{"service_nested":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}}},"displayName":null,"basePath":{"head":"/nested","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_nested.calculate","name":{"originalName":"calculate","camelCase":{"unsafeName":"calculate","safeName":"calculate"},"snakeCase":{"unsafeName":"calculate","safeName":"calculate"},"screamingSnakeCase":{"unsafeName":"CALCULATE","safeName":"CALCULATE"},"pascalCase":{"unsafeName":"Calculate","safeName":"Calculate"}},"displayName":null,"auth":true,"idempotent":false,"baseUrl":null,"method":"POST","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"/nested","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":{"type":"json","value":{"type":"response","responseBodyType":{"_type":"named","name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response","default":null,"inline":null},"docs":null}},"status-code":null},"errors":[],"userSpecifiedExamples":[{"example":{"id":"5a6f08f1a5b7c467c617c891b9b6e1f85c3cdaa17c9bc1a56012234eeb809937","name":null,"url":"/nested","rootPathParameters":[],"endpointPathParameters":[],"servicePathParameters":[],"endpointHeaders":[],"serviceHeaders":[],"queryParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","typeName":{"typeId":"type_nested:Response","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"container","container":{"type":"map","map":[{"key":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"b"}}},"jsonExample":"b"},"value":{"shape":{"type":"named","typeName":{"typeId":"type_nested:Product","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}}},"shape":{"type":"object","properties":[{"name":{"name":{"originalName":"c","camelCase":{"unsafeName":"c","safeName":"c"},"snakeCase":{"unsafeName":"c","safeName":"c"},"screamingSnakeCase":{"unsafeName":"C","safeName":"C"},"pascalCase":{"unsafeName":"C","safeName":"C"}},"wireValue":"c"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"unknown","unknown":{"d":{"e":"$11","f":"hello"}}},"jsonExample":{"d":{"e":"$11","f":"hello"}}},"valueType":{"_type":"unknown"}}},"jsonExample":{"d":{"e":"$11","f":"hello"}}},"originalTypeDeclaration":{"typeId":"type_nested:Product","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}}}}]}},"jsonExample":{"c":{"d":{"e":"$11","f":"hello"}}}}}],"keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}},"jsonExample":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}},"valueType":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}},"jsonExample":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}},"originalTypeDeclaration":{"typeId":"type_nested:Response","fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}}}}]}},"jsonExample":{"a":{"b":{"c":{"d":{"e":"$11","f":"hello"}}}}}}}},"docs":null},"codeSamples":null}],"autogeneratedExamples":[{"example":{"id":"551653f550d18c803cccca4e174c46294d99f392","url":"/nested","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":{"shape":{"type":"named","shape":{"type":"object","properties":[{"name":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"wireValue":"a"},"originalTypeDeclaration":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"container","container":{"type":"map","map":[{"key":{"shape":{"type":"primitive","primitive":{"type":"string","string":{"original":"a"}}},"jsonExample":"a"},"value":{"shape":{"type":"named","shape":{"type":"object","properties":[{"name":{"name":{"originalName":"c","camelCase":{"unsafeName":"c","safeName":"c"},"snakeCase":{"unsafeName":"c","safeName":"c"},"screamingSnakeCase":{"unsafeName":"C","safeName":"C"},"pascalCase":{"unsafeName":"C","safeName":"C"}},"wireValue":"c"},"originalTypeDeclaration":{"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product"},"value":{"shape":{"type":"container","container":{"type":"optional","optional":{"shape":{"type":"unknown","unknown":{"key":"value"}},"jsonExample":{"key":"value"}},"valueType":{"_type":"unknown"}}},"jsonExample":{"key":"value"}}}]},"typeName":{"name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product"}},"jsonExample":{"c":{"key":"value"}}}}],"keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}},"jsonExample":{"a":{"c":{"key":"value"}}}},"valueType":{"_type":"container","container":{"_type":"map","keyType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"valueType":{"_type":"named","name":{"originalName":"Product","camelCase":{"unsafeName":"product","safeName":"product"},"snakeCase":{"unsafeName":"product","safeName":"product"},"screamingSnakeCase":{"unsafeName":"PRODUCT","safeName":"PRODUCT"},"pascalCase":{"unsafeName":"Product","safeName":"Product"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Product","default":null,"inline":null}}}}},"jsonExample":{"a":{"c":{"key":"value"}}}}}]},"typeName":{"name":{"originalName":"Response","camelCase":{"unsafeName":"response","safeName":"response"},"snakeCase":{"unsafeName":"response","safeName":"response"},"screamingSnakeCase":{"unsafeName":"RESPONSE","safeName":"RESPONSE"},"pascalCase":{"unsafeName":"Response","safeName":"Response"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"typeId":"type_nested:Response"}},"jsonExample":{"a":{"a":{"c":{"key":"value"}}}}}}},"docs":null}}],"pagination":null,"availability":null,"docs":null}]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{"service_nested":["type_nested:Response"]},"sharedTypes":["type_nested:Product","type_nested:StringAlias"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"subpackages":{"subpackage_nested":{"name":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}},"fernFilepath":{"allParts":[{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}],"packagePath":[],"file":{"originalName":"nested","camelCase":{"unsafeName":"nested","safeName":"nested"},"snakeCase":{"unsafeName":"nested","safeName":"nested"},"screamingSnakeCase":{"unsafeName":"NESTED","safeName":"NESTED"},"pascalCase":{"unsafeName":"Nested","safeName":"Nested"}}},"service":"service_nested","types":["type_nested:Response","type_nested:Product","type_nested:StringAlias"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":null,"types":[],"errors":[],"subpackages":["subpackage_nested"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":true,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; exports[`ir > {"name":"packages"} 1`] = `"{"fdrApiDefinitionId":null,"apiVersion":null,"apiName":{"originalName":"packages","camelCase":{"unsafeName":"packages","safeName":"packages"},"snakeCase":{"unsafeName":"packages","safeName":"packages"},"screamingSnakeCase":{"unsafeName":"PACKAGES","safeName":"PACKAGES"},"pascalCase":{"unsafeName":"Packages","safeName":"Packages"}},"apiDisplayName":null,"apiDocs":null,"auth":{"requirement":"ALL","schemes":[],"docs":null},"headers":[],"idempotencyHeaders":[],"types":{"type_:RootString":{"inline":false,"name":{"name":{"originalName":"RootString","camelCase":{"unsafeName":"rootString","safeName":"rootString"},"snakeCase":{"unsafeName":"root_string","safeName":"root_string"},"screamingSnakeCase":{"unsafeName":"ROOT_STRING","safeName":"ROOT_STRING"},"pascalCase":{"unsafeName":"RootString","safeName":"RootString"}},"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"typeId":"type_:RootString"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_package:PackageString":{"inline":false,"name":{"name":{"originalName":"PackageString","camelCase":{"unsafeName":"packageString","safeName":"packageString"},"snakeCase":{"unsafeName":"package_string","safeName":"package_string"},"screamingSnakeCase":{"unsafeName":"PACKAGE_STRING","safeName":"PACKAGE_STRING"},"pascalCase":{"unsafeName":"PackageString","safeName":"PackageString"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":null},"typeId":"type_package:PackageString"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_importer:Foo":{"inline":false,"name":{"name":{"originalName":"Foo","camelCase":{"unsafeName":"foo","safeName":"foo"},"snakeCase":{"unsafeName":"foo","safeName":"foo"},"screamingSnakeCase":{"unsafeName":"FOO","safeName":"FOO"},"pascalCase":{"unsafeName":"Foo","safeName":"Foo"}},"fernFilepath":{"allParts":[{"originalName":"importer","camelCase":{"unsafeName":"importer","safeName":"importer"},"snakeCase":{"unsafeName":"importer","safeName":"importer"},"screamingSnakeCase":{"unsafeName":"IMPORTER","safeName":"IMPORTER"},"pascalCase":{"unsafeName":"Importer","safeName":"Importer"}}],"packagePath":[],"file":{"originalName":"importer","camelCase":{"unsafeName":"importer","safeName":"importer"},"snakeCase":{"unsafeName":"importer","safeName":"importer"},"screamingSnakeCase":{"unsafeName":"IMPORTER","safeName":"IMPORTER"},"pascalCase":{"unsafeName":"Importer","safeName":"Importer"}}},"typeId":"type_importer:Foo"},"shape":{"_type":"object","extends":[],"properties":[{"name":{"name":{"originalName":"root","camelCase":{"unsafeName":"root","safeName":"root"},"snakeCase":{"unsafeName":"root","safeName":"root"},"screamingSnakeCase":{"unsafeName":"ROOT","safeName":"ROOT"},"pascalCase":{"unsafeName":"Root","safeName":"Root"}},"wireValue":"root"},"valueType":{"_type":"named","name":{"originalName":"RootString","camelCase":{"unsafeName":"rootString","safeName":"rootString"},"snakeCase":{"unsafeName":"root_string","safeName":"root_string"},"screamingSnakeCase":{"unsafeName":"ROOT_STRING","safeName":"ROOT_STRING"},"pascalCase":{"unsafeName":"RootString","safeName":"RootString"}},"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"typeId":"type_:RootString","default":null,"inline":null},"availability":null,"docs":null},{"name":{"name":{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}},"wireValue":"package"},"valueType":{"_type":"named","name":{"originalName":"PackageString","camelCase":{"unsafeName":"packageString","safeName":"packageString"},"snakeCase":{"unsafeName":"package_string","safeName":"package_string"},"screamingSnakeCase":{"unsafeName":"PACKAGE_STRING","safeName":"PACKAGE_STRING"},"pascalCase":{"unsafeName":"PackageString","safeName":"PackageString"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":null},"typeId":"type_package:PackageString","default":null,"inline":null},"availability":null,"docs":null}],"extra-properties":false,"extendedProperties":[]},"referencedTypes":["type_:RootString","type_package:PackageString"],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null},"type_package/a:A":{"inline":false,"name":{"name":{"originalName":"A","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}},{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}}},"typeId":"type_package/a:A"},"shape":{"_type":"alias","aliasOf":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}},"resolvedType":{"_type":"primitive","primitive":{"v1":"STRING","v2":{"type":"string","default":null,"validation":null}}}},"referencedTypes":[],"encoding":{"json":{},"proto":null},"source":null,"userProvidedExamples":[],"autogeneratedExamples":[],"availability":null,"docs":null}},"errors":{},"services":{"service_":{"availability":null,"name":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null}},"displayName":null,"basePath":{"head":"/","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[{"id":"endpoint_.rootEndpoint","name":{"originalName":"rootEndpoint","camelCase":{"unsafeName":"rootEndpoint","safeName":"rootEndpoint"},"snakeCase":{"unsafeName":"root_endpoint","safeName":"root_endpoint"},"screamingSnakeCase":{"unsafeName":"ROOT_ENDPOINT","safeName":"ROOT_ENDPOINT"},"pascalCase":{"unsafeName":"RootEndpoint","safeName":"RootEndpoint"}},"displayName":null,"auth":false,"idempotent":false,"baseUrl":null,"method":"GET","basePath":null,"path":{"head":"","parts":[]},"fullPath":{"head":"","parts":[]},"pathParameters":[],"allPathParameters":[],"queryParameters":[],"headers":[],"requestBody":null,"sdkRequest":null,"response":{"body":null,"status-code":null},"errors":[],"userSpecifiedExamples":[],"autogeneratedExamples":[{"example":{"id":"0151c4f21dcb59ded0264beca4e001f6c9a6203a","url":"","name":null,"endpointHeaders":[],"endpointPathParameters":[],"queryParameters":[],"servicePathParameters":[],"serviceHeaders":[],"rootPathParameters":[],"request":null,"response":{"type":"ok","value":{"type":"body","value":null}},"docs":null}}],"pagination":null,"availability":null,"docs":null}]},"service_package":{"availability":null,"name":{"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":null}},"displayName":null,"basePath":{"head":"/","parts":[]},"headers":[],"pathParameters":[],"encoding":{"json":{},"proto":null},"transport":{"type":"http"},"endpoints":[]}},"constants":{"errorInstanceIdKey":{"name":{"originalName":"errorInstanceId","camelCase":{"unsafeName":"errorInstanceId","safeName":"errorInstanceId"},"snakeCase":{"unsafeName":"error_instance_id","safeName":"error_instance_id"},"screamingSnakeCase":{"unsafeName":"ERROR_INSTANCE_ID","safeName":"ERROR_INSTANCE_ID"},"pascalCase":{"unsafeName":"ErrorInstanceId","safeName":"ErrorInstanceId"}},"wireValue":"errorInstanceId"}},"environments":null,"errorDiscriminationStrategy":{"type":"statusCode"},"basePath":null,"pathParameters":[],"variables":[],"serviceTypeReferenceInfo":{"typesReferencedOnlyByService":{},"sharedTypes":["type_:RootString","type_package:PackageString","type_importer:Foo","type_package/a:A"]},"webhookGroups":{},"websocketChannels":{},"readmeConfig":null,"sourceConfig":null,"publishConfig":null,"subpackages":{"subpackage_package":{"name":{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":null},"service":"service_package","types":["type_package:PackageString"],"errors":[],"subpackages":["subpackage_package/b","subpackage_package/a"],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":true,"docs":null},"subpackage_importer":{"name":{"originalName":"importer","camelCase":{"unsafeName":"importer","safeName":"importer"},"snakeCase":{"unsafeName":"importer","safeName":"importer"},"screamingSnakeCase":{"unsafeName":"IMPORTER","safeName":"IMPORTER"},"pascalCase":{"unsafeName":"Importer","safeName":"Importer"}},"fernFilepath":{"allParts":[{"originalName":"importer","camelCase":{"unsafeName":"importer","safeName":"importer"},"snakeCase":{"unsafeName":"importer","safeName":"importer"},"screamingSnakeCase":{"unsafeName":"IMPORTER","safeName":"IMPORTER"},"pascalCase":{"unsafeName":"Importer","safeName":"Importer"}}],"packagePath":[],"file":{"originalName":"importer","camelCase":{"unsafeName":"importer","safeName":"importer"},"snakeCase":{"unsafeName":"importer","safeName":"importer"},"screamingSnakeCase":{"unsafeName":"IMPORTER","safeName":"IMPORTER"},"pascalCase":{"unsafeName":"Importer","safeName":"Importer"}}},"service":null,"types":["type_importer:Foo"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":"I'm an importer!"},"subpackage_package/a":{"name":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}},{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":{"originalName":"a","camelCase":{"unsafeName":"a","safeName":"a"},"snakeCase":{"unsafeName":"a","safeName":"a"},"screamingSnakeCase":{"unsafeName":"A","safeName":"A"},"pascalCase":{"unsafeName":"A","safeName":"A"}}},"service":null,"types":["type_package/a:A"],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null},"subpackage_package/b":{"name":{"originalName":"b","camelCase":{"unsafeName":"b","safeName":"b"},"snakeCase":{"unsafeName":"b","safeName":"b"},"screamingSnakeCase":{"unsafeName":"B","safeName":"B"},"pascalCase":{"unsafeName":"B","safeName":"B"}},"fernFilepath":{"allParts":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}},{"originalName":"b","camelCase":{"unsafeName":"b","safeName":"b"},"snakeCase":{"unsafeName":"b","safeName":"b"},"screamingSnakeCase":{"unsafeName":"B","safeName":"B"},"pascalCase":{"unsafeName":"B","safeName":"B"}}],"packagePath":[{"originalName":"package","camelCase":{"unsafeName":"package","safeName":"package"},"snakeCase":{"unsafeName":"package","safeName":"package"},"screamingSnakeCase":{"unsafeName":"PACKAGE","safeName":"PACKAGE"},"pascalCase":{"unsafeName":"Package","safeName":"Package"}}],"file":{"originalName":"b","camelCase":{"unsafeName":"b","safeName":"b"},"snakeCase":{"unsafeName":"b","safeName":"b"},"screamingSnakeCase":{"unsafeName":"B","safeName":"B"},"pascalCase":{"unsafeName":"B","safeName":"B"}}},"service":null,"types":[],"errors":[],"subpackages":[],"navigationConfig":null,"webhooks":null,"websocket":null,"hasEndpointsInTree":false,"docs":null}},"rootPackage":{"fernFilepath":{"allParts":[],"packagePath":[],"file":null},"websocket":null,"service":"service_","types":["type_:RootString"],"errors":[],"subpackages":["subpackage_package","subpackage_importer"],"webhooks":null,"navigationConfig":null,"hasEndpointsInTree":true,"docs":null},"sdkConfig":{"isAuthMandatory":false,"hasStreamingEndpoints":false,"hasPaginatedEndpoints":false,"hasFileDownloadEndpoints":false,"platformHeaders":{"language":"X-Fern-Language","sdkName":"X-Fern-SDK-Name","sdkVersion":"X-Fern-SDK-Version","userAgent":null}}}"`; 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..039f0f19c84 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type__AliasType.json @@ -0,0 +1,17 @@ +{ + "$ref": "#/definitions/Parent", + "definitions": { + "Parent": { + "type": "object", + "properties": { + "parent": { + "type": "string" + } + }, + "required": [ + "parent" + ], + "additionalProperties": false + } + } +} \ 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..b4ec57604be --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type__Child.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "parent": { + "type": "string" + }, + "child": { + "type": "string" + } + }, + "required": [ + "parent", + "child" + ], + "additionalProperties": false, + "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..485341b3141 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias-extends/type__Parent.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "parent": { + "type": "string" + } + }, + "required": [ + "parent" + ], + "additionalProperties": false, + "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..3512b589ee4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type__Object.json @@ -0,0 +1,24 @@ +{ + "$ref": "#/definitions/Type", + "definitions": { + "TypeId": { + "type": "string" + }, + "Type": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/TypeId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + } +} \ 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..0689f2fa3df --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/alias/type__Type.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/TypeId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..93c36010791 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_auth_TokenResponse.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "access_token", + "expires_in" + ], + "additionalProperties": false, + "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..59aea8dcfbe --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/any-auth/type_user_User.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..d5af2d1b3e9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-a/service_Response.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-b.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "folder-c.common.FolderCFoo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-c.common.FolderCFoo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..6184b39a113 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-b/common_Foo.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-c.common.FolderCFoo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "folder-c.common.FolderCFoo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false + } + } +} \ 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..a01a66535f8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-c/common_FolderCFoo.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false, + "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..080dd1a61ae --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_folder-d/service_Response.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ], + "additionalProperties": false, + "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..ea4d461c3b1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo_FilteredType.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "public_property": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "private_property": { + "type": "integer" + } + }, + "required": [ + "private_property" + ], + "additionalProperties": false, + "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..f0e171bd070 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo_ImportingType.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "imported": { + "$ref": "#/definitions/commons.Imported" + } + }, + "required": [ + "imported" + ], + "additionalProperties": false, + "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..97db51f9b40 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/audiences/type_foo_OptionalString.json @@ -0,0 +1,11 @@ +{ + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth-environment-variables/type_errors_UnauthorizedRequestErrorBody.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/basic-auth/type_errors_UnauthorizedRequestErrorBody.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..e5a084609a8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type__ImportingA.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "a": { + "oneOf": [ + { + "$ref": "#/definitions/a.A" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "a.A": { + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false + } + } +} \ 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..10f782ad5f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type__RootType.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false, + "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..10f782ad5f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_a_A.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false, + "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..b0a1ccf3fb1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_ContainerValue.json @@ -0,0 +1,169 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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..8e2c3ab66b9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_FieldValue.json @@ -0,0 +1,170 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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..60a8dc3bcde --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references-advanced/type_ast_ObjectFieldValue.json @@ -0,0 +1,135 @@ +{ + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/ast.FieldName" + }, + "value": { + "$ref": "#/definitions/ast.FieldValue" + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..e5a084609a8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type__ImportingA.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "a": { + "oneOf": [ + { + "$ref": "#/definitions/a.A" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "a.A": { + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false + } + } +} \ 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..10f782ad5f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type__RootType.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false, + "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..10f782ad5f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_a_A.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "s": { + "type": "string" + } + }, + "required": [ + "s" + ], + "additionalProperties": false, + "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..b0a1ccf3fb1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast_ContainerValue.json @@ -0,0 +1,169 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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..8e2c3ab66b9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast_FieldValue.json @@ -0,0 +1,170 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/ast.FieldValue" + }, + { + "type": "null" + } + ] + } + }, + "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..657971ea9fc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/circular-references/type_ast_JsonLike.json @@ -0,0 +1,52 @@ +{ + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ast.JsonLike" + } + }, + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "definitions": { + "ast.JsonLike": { + "anyOf": [ + { + "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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..badefa5b085 --- /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,47 @@ +{ + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-b.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-c.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..3531b3c6c12 --- /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,31 @@ +{ + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-c.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false + } + } +} \ 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..a01a66535f8 --- /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,14 @@ +{ + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false, + "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..badefa5b085 --- /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,47 @@ +{ + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-b.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "folder-c.common.Foo": { + "type": "object", + "properties": { + "bar_property": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "bar_property" + ], + "additionalProperties": false + }, + "folder-b.common.Foo": { + "type": "object", + "properties": { + "foo": { + "oneOf": [ + { + "$ref": "#/definitions/folder-c.common.Foo" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..f0e171bd070 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo_ImportingType.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "imported": { + "$ref": "#/definitions/commons.Imported" + } + }, + "required": [ + "imported" + ], + "additionalProperties": false, + "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..97db51f9b40 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/cross-package-type-names/type_foo_OptionalString.json @@ -0,0 +1,11 @@ +{ + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..4596b4897b8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_a/aa_SubTestType.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.aa.A" + }, + "b": { + "$ref": "#/definitions/a.aa.B" + } + }, + "required": [ + "a", + "b" + ], + "additionalProperties": false, + "definitions": { + "a.aa.A": { + "type": "object", + "additionalProperties": false + }, + "a.aa.B": { + "type": "object", + "additionalProperties": false + } + } +} \ 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..4596b4897b8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_b_TestType.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "a": { + "$ref": "#/definitions/a.aa.A" + }, + "b": { + "$ref": "#/definitions/a.aa.B" + } + }, + "required": [ + "a", + "b" + ], + "additionalProperties": false, + "definitions": { + "a.aa.A": { + "type": "object", + "additionalProperties": false + }, + "a.aa.B": { + "type": "object", + "additionalProperties": false + } + } +} \ 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..d352068bd6b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/csharp-namespace-conflict/type_tasktest_Task.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/custom-auth/type_errors_UnauthorizedRequestErrorBody.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..c4fad775236 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/enum/type__ColorOrOperand.json @@ -0,0 +1,27 @@ +{ + "anyOf": [ + { + "$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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/error-property/type_errors_PropertyBasedErrorTestBody.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..7d265d41ede --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type__Identifier.json @@ -0,0 +1,47 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "type", + "value", + "label" + ], + "additionalProperties": false, + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "anyOf": [ + { + "$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..c6897f0b7d4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type__Type.json @@ -0,0 +1,27 @@ +{ + "anyOf": [ + { + "$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..6f508319e02 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types_EventInfo.json @@ -0,0 +1,72 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "metadata", + "tag" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "metadata" + }, + "id": { + "type": "string" + }, + "data": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "jsonString": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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..88625618eb6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_commons/types_Metadata.json @@ -0,0 +1,36 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "jsonString": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..80e31d78097 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Actor.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false, + "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..80e31d78097 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Actress.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false, + "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..f5161911edf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_CastMember.json @@ -0,0 +1,63 @@ +{ + "anyOf": [ + { + "$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" + ], + "additionalProperties": false + }, + "types.Actress": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + }, + "types.StuntDouble": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "actorOrActressId": { + "type": "string" + } + }, + "required": [ + "name", + "actorOrActressId" + ], + "additionalProperties": false + } + } +} \ 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..7a400aceb83 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Directory.json @@ -0,0 +1,94 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.File" + } + }, + { + "type": "null" + } + ] + }, + "directories": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Directory" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "types.File": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "name", + "contents" + ], + "additionalProperties": false + }, + "types.Directory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.File" + } + }, + { + "type": "null" + } + ] + }, + "directories": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Directory" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..b3e0b1a10bf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Entity.json @@ -0,0 +1,43 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "name": { + "type": "string" + } + }, + "required": [ + "type", + "name" + ], + "additionalProperties": false, + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "anyOf": [ + { + "$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..1e0c5a7d705 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_ExceptionInfo.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false, + "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..f89c577a9b6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_ExtendedMovie.json @@ -0,0 +1,85 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/types.MovieId" + }, + "prequel": { + "oneOf": [ + { + "$ref": "#/definitions/types.MovieId" + }, + { + "type": "null" + } + ] + }, + "title": { + "type": "string" + }, + "from": { + "type": "string" + }, + "rating": { + "type": "number" + }, + "type": { + "const": "movie" + }, + "tag": { + "$ref": "#/definitions/commons.types.Tag" + }, + "book": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "revenue": { + "type": "integer" + }, + "cast": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "id", + "title", + "from", + "rating", + "type", + "tag", + "metadata", + "revenue", + "cast" + ], + "additionalProperties": false, + "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_File.json b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_File.json new file mode 100644 index 00000000000..aed6889608a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_File.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "name", + "contents" + ], + "additionalProperties": false, + "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..4996fbf9edf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Migration.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/types.MigrationStatus" + } + }, + "required": [ + "name", + "status" + ], + "additionalProperties": false, + "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..90d70d78edd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Moment.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "date": { + "type": "string", + "format": "date" + }, + "datetime": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "date", + "datetime" + ], + "additionalProperties": false, + "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..efe96043a3e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Movie.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/types.MovieId" + }, + "prequel": { + "oneOf": [ + { + "$ref": "#/definitions/types.MovieId" + }, + { + "type": "null" + } + ] + }, + "title": { + "type": "string" + }, + "from": { + "type": "string" + }, + "rating": { + "type": "number" + }, + "type": { + "const": "movie" + }, + "tag": { + "$ref": "#/definitions/commons.types.Tag" + }, + "book": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "revenue": { + "type": "integer" + } + }, + "required": [ + "id", + "title", + "from", + "rating", + "type", + "tag", + "metadata", + "revenue" + ], + "additionalProperties": false, + "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..4c6426db3e3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Node.json @@ -0,0 +1,97 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + }, + "trees": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "definitions": { + "types.Tree": { + "type": "object", + "properties": { + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "types.Node": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + }, + "trees": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..454096337de --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Request.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "request": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "request" + ], + "additionalProperties": false, + "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..1a04e6b481e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Response.json @@ -0,0 +1,73 @@ +{ + "type": "object", + "properties": { + "response": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + }, + "identifiers": { + "type": "array", + "items": { + "$ref": "#/definitions/Identifier" + } + } + }, + "required": [ + "response", + "identifiers" + ], + "additionalProperties": false, + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "anyOf": [ + { + "$ref": "#/definitions/BasicType" + }, + { + "$ref": "#/definitions/ComplexType" + } + ] + }, + "Identifier": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + }, + "value": { + "type": "string" + }, + "label": { + "type": "string" + } + }, + "required": [ + "type", + "value", + "label" + ], + "additionalProperties": false + } + } +} \ 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..befa8658ee3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_ResponseType.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/Type" + } + }, + "required": [ + "type" + ], + "additionalProperties": false, + "definitions": { + "BasicType": { + "type": "string", + "enum": [ + "primitive", + "literal" + ] + }, + "ComplexType": { + "type": "string", + "enum": [ + "object", + "union", + "unknown" + ] + }, + "Type": { + "anyOf": [ + { + "$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..5e9f678fb82 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_StuntDouble.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "actorOrActressId": { + "type": "string" + } + }, + "required": [ + "name", + "actorOrActressId" + ], + "additionalProperties": false, + "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..b899e85321e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/examples/type_types_Tree.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "types.Tree": { + "type": "object", + "properties": { + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "types.Node": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Node" + } + }, + { + "type": "null" + } + ] + }, + "trees": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/types.Tree" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_general-errors_BadObjectRequestInfo.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..367401f9d36 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_DoubleOptional.json @@ -0,0 +1,28 @@ +{ + "type": "object", + "properties": { + "optionalAlias": { + "oneOf": [ + { + "$ref": "#/definitions/types.object.OptionalAlias" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "types.object.OptionalAlias": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } +} \ 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..84223507008 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_NestedObjectWithOptionalField.json @@ -0,0 +1,179 @@ +{ + "type": "object", + "properties": { + "string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "NestedObject": { + "oneOf": [ + { + "$ref": "#/definitions/types.object.ObjectWithOptionalField" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "types.object.ObjectWithOptionalField": { + "type": "object", + "properties": { + "string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "integer": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "long": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "double": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "bool": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "datetime": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "date": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + }, + "uuid": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "base64": { + "oneOf": [ + { + "type": "string", + "contentEncoding": "base64" + }, + { + "type": "null" + } + ] + }, + "list": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "set": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + { + "type": "null" + } + ] + }, + "map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "bigint": { + "oneOf": [ + { + "type": "string", + "pattern": "^-?[0-9]+$" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..395c9e39804 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_NestedObjectWithRequiredField.json @@ -0,0 +1,169 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + }, + "NestedObject": { + "$ref": "#/definitions/types.object.ObjectWithOptionalField" + } + }, + "required": [ + "string", + "NestedObject" + ], + "additionalProperties": false, + "definitions": { + "types.object.ObjectWithOptionalField": { + "type": "object", + "properties": { + "string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "integer": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "long": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "double": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "bool": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "datetime": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "date": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + }, + "uuid": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "base64": { + "oneOf": [ + { + "type": "string", + "contentEncoding": "base64" + }, + { + "type": "null" + } + ] + }, + "list": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "set": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + { + "type": "null" + } + ] + }, + "map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "bigint": { + "oneOf": [ + { + "type": "string", + "pattern": "^-?[0-9]+$" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..907017a0d03 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_ObjectWithMapOfMap.json @@ -0,0 +1,19 @@ +{ + "type": "object", + "properties": { + "map": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "required": [ + "map" + ], + "additionalProperties": false, + "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..301139a3986 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_ObjectWithOptionalField.json @@ -0,0 +1,152 @@ +{ + "type": "object", + "properties": { + "string": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "integer": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "long": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "double": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "bool": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "datetime": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "date": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + }, + "uuid": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "base64": { + "oneOf": [ + { + "type": "string", + "contentEncoding": "base64" + }, + { + "type": "null" + } + ] + }, + "list": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "set": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + { + "type": "null" + } + ] + }, + "map": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "bigint": { + "oneOf": [ + { + "type": "string", + "pattern": "^-?[0-9]+$" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..89e2e0481a3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_ObjectWithRequiredField.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "string": { + "type": "string" + } + }, + "required": [ + "string" + ], + "additionalProperties": false, + "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..97db51f9b40 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/object_OptionalAlias.json @@ -0,0 +1,11 @@ +{ + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "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..16bed6ba439 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union_Cat.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "likesToMeow": { + "type": "boolean" + } + }, + "required": [ + "name", + "likesToMeow" + ], + "additionalProperties": false, + "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..e0d46ed0d8a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/exhaustive/type_types/union_Dog.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "likesToWoof": { + "type": "boolean" + } + }, + "required": [ + "name", + "likesToWoof" + ], + "additionalProperties": false, + "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..063f21d9d3c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type__Docs.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ], + "additionalProperties": false, + "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..8adc6315f1a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type__ExampleType.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "docs", + "name" + ], + "additionalProperties": false, + "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..e37ef516d47 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type__JSON.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + }, + "raw": { + "type": "string" + } + }, + "required": [ + "docs", + "raw" + ], + "additionalProperties": false, + "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..4f275cb9a7c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extends/type__NestedType.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "raw": { + "type": "string" + }, + "docs": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "raw", + "docs", + "name" + ], + "additionalProperties": false, + "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..1166f3828c1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type__Failure.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "status": { + "const": "failure" + } + }, + "required": [ + "status" + ], + "additionalProperties": true, + "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..8b1a3734c78 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/extra-properties/type_user_User.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": true, + "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..080dd1a61ae --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/file-upload/type_service_MyObject.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "string" + } + }, + "required": [ + "foo" + ], + "additionalProperties": false, + "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..eef0d7ac8aa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/go-content-type/type_imdb_CreateMovieRequest.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "title", + "rating" + ], + "additionalProperties": false, + "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..2e037c2df9c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__Column.json @@ -0,0 +1,100 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "values" + ], + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + } + } +} \ 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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..ff833e2184b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__DescribeResponse.json @@ -0,0 +1,70 @@ +{ + "type": "object", + "properties": { + "namespaces": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/NamespaceSummary" + } + }, + { + "type": "null" + } + ] + }, + "dimension": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + }, + "fullness": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "totalCount": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "NamespaceSummary": { + "type": "object", + "properties": { + "count": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..c08d8b8b3b8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__FetchResponse.json @@ -0,0 +1,156 @@ +{ + "type": "object", + "properties": { + "columns": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/Column" + } + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "usage": { + "oneOf": [ + { + "$ref": "#/definitions/Usage" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + }, + "Column": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "values" + ], + "additionalProperties": false + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..1825538ce91 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__IndexedData.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "indices": { + "type": "array", + "items": { + "type": "integer", + "minimum": 0 + } + }, + "values": { + "type": "array", + "items": { + "type": "number" + } + } + }, + "required": [ + "indices", + "values" + ], + "additionalProperties": false, + "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..05f2b9661f6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__ListElement.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..d88fde68362 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__ListResponse.json @@ -0,0 +1,100 @@ +{ + "type": "object", + "properties": { + "columns": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ListElement" + } + }, + { + "type": "null" + } + ] + }, + "pagination": { + "oneOf": [ + { + "$ref": "#/definitions/Pagination" + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "usage": { + "oneOf": [ + { + "$ref": "#/definitions/Usage" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "ListElement": { + "type": "object", + "properties": { + "id": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Pagination": { + "type": "object", + "properties": { + "next": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..cb86dba2f66 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__Metadata.json @@ -0,0 +1,38 @@ +{ + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ], + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "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..8eadd5b7552 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__MetadataValue.json @@ -0,0 +1,14 @@ +{ + "anyOf": [ + { + "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..8643c2cec21 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__NamespaceSummary.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "count": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..2ab3ed4b018 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__Pagination.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "next": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..e8b51935264 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__QueryColumn.json @@ -0,0 +1,117 @@ +{ + "type": "object", + "properties": { + "values": { + "type": "array", + "items": { + "type": "number" + } + }, + "topK": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "filter": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "values" + ], + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + } + } +} \ 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..10daf0c5fd8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__QueryResponse.json @@ -0,0 +1,214 @@ +{ + "type": "object", + "properties": { + "results": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/QueryResult" + } + }, + { + "type": "null" + } + ] + }, + "matches": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "usage": { + "oneOf": [ + { + "$ref": "#/definitions/Usage" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + }, + "ScoredColumn": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "QueryResult": { + "type": "object", + "properties": { + "matches": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "Usage": { + "type": "object", + "properties": { + "units": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..7e4ebc95350 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__QueryResult.json @@ -0,0 +1,145 @@ +{ + "type": "object", + "properties": { + "matches": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/ScoredColumn" + } + }, + { + "type": "null" + } + ] + }, + "namespace": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + }, + "ScoredColumn": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + } +} \ 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..4667e397cdc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__ScoredColumn.json @@ -0,0 +1,116 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "score": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "values": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + }, + "indexedData": { + "oneOf": [ + { + "$ref": "#/definitions/IndexedData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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" + ], + "additionalProperties": false + } + } +} \ 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..2b13c5c0434 --- /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", + "additionalProperties": false, + "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..8643c2cec21 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__UploadResponse.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "count": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..654daa628c2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto-exhaustive/type__Usage.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "units": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..e0ed89188b9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type__CreateResponse.json @@ -0,0 +1,111 @@ +{ + "type": "object", + "properties": { + "user": { + "oneOf": [ + { + "$ref": "#/definitions/UserModel" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ] + }, + "UserModel": { + "type": "object", + "properties": { + "username": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "email": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "age": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + }, + "weight": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..cb86dba2f66 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type__Metadata.json @@ -0,0 +1,38 @@ +{ + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/MetadataValue" + } + }, + { + "type": "object", + "additionalProperties": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + } + ], + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "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..8eadd5b7552 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type__MetadataValue.json @@ -0,0 +1,14 @@ +{ + "anyOf": [ + { + "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..8dc0dd513eb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/grpc-proto/type__UserModel.json @@ -0,0 +1,95 @@ +{ + "type": "object", + "properties": { + "username": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "email": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "age": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + }, + "weight": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/Metadata" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "MetadataValue": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "Metadata": { + "anyOf": [ + { + "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..eef0d7ac8aa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb_CreateMovieRequest.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "title", + "rating" + ], + "additionalProperties": false, + "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..7efcc3b44b0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/imdb/type_imdb_Movie.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/imdb.MovieId" + }, + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "rating" + ], + "additionalProperties": false, + "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..6abace4ca43 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type__SendResponse.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "success": { + "const": true + } + }, + "required": [ + "message", + "status", + "success" + ], + "additionalProperties": false, + "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..9b7d0652ff1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined_ANestedLiteral.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "myLiteral": { + "const": "How super cool" + } + }, + "required": [ + "myLiteral" + ], + "additionalProperties": false, + "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..4c3fe7c7a0c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined_ATopLevelLiteral.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "nestedLiteral": { + "$ref": "#/definitions/inlined.ANestedLiteral" + } + }, + "required": [ + "nestedLiteral" + ], + "additionalProperties": false, + "definitions": { + "inlined.ANestedLiteral": { + "type": "object", + "properties": { + "myLiteral": { + "const": "How super cool" + } + }, + "required": [ + "myLiteral" + ], + "additionalProperties": false + } + } +} \ 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..6fbd13c8d7c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_inlined_SomeAliasedLiteral.json @@ -0,0 +1,4 @@ +{ + "const": "You're super wise", + "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..296cf8e350b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference_ContainerObject.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "nestedObjects": { + "type": "array", + "items": { + "$ref": "#/definitions/reference.NestedObjectWithLiterals" + } + } + }, + "required": [ + "nestedObjects" + ], + "additionalProperties": false, + "definitions": { + "reference.NestedObjectWithLiterals": { + "type": "object", + "properties": { + "literal1": { + "const": "literal1" + }, + "literal2": { + "const": "literal2" + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ], + "additionalProperties": false + } + } +} \ 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..c5e332690a1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference_NestedObjectWithLiterals.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "literal1": { + "const": "literal1" + }, + "literal2": { + "const": "literal2" + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ], + "additionalProperties": false, + "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..8f3ae38bc82 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference_SendRequest.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "prompt": { + "const": "You are a helpful assistant" + }, + "query": { + "type": "string" + }, + "stream": { + "const": false + }, + "context": { + "$ref": "#/definitions/reference.SomeLiteral" + }, + "maybeContext": { + "oneOf": [ + { + "$ref": "#/definitions/reference.SomeLiteral" + }, + { + "type": "null" + } + ] + }, + "containerObject": { + "$ref": "#/definitions/reference.ContainerObject" + } + }, + "required": [ + "prompt", + "query", + "stream", + "context", + "containerObject" + ], + "additionalProperties": false, + "definitions": { + "reference.SomeLiteral": { + "const": "You're super wise" + }, + "reference.NestedObjectWithLiterals": { + "type": "object", + "properties": { + "literal1": { + "const": "literal1" + }, + "literal2": { + "const": "literal2" + }, + "strProp": { + "type": "string" + } + }, + "required": [ + "literal1", + "literal2", + "strProp" + ], + "additionalProperties": false + }, + "reference.ContainerObject": { + "type": "object", + "properties": { + "nestedObjects": { + "type": "array", + "items": { + "$ref": "#/definitions/reference.NestedObjectWithLiterals" + } + } + }, + "required": [ + "nestedObjects" + ], + "additionalProperties": false + } + } +} \ 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..6fbd13c8d7c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/literal/type_reference_SomeLiteral.json @@ -0,0 +1,4 @@ +{ + "const": "You're super wise", + "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..d597a5e09d2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service_NestedUser.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "NestedUser": { + "$ref": "#/definitions/service.User" + } + }, + "required": [ + "Name", + "NestedUser" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..5f38ad38445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service_Organization.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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..9c955b0163c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-case/type_service_User.json @@ -0,0 +1,27 @@ +{ + "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" + ], + "additionalProperties": false, + "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..5f38ad38445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization_CreateOrganizationRequest.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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..6efe0928b5a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_organization_Organization.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/user.User" + } + } + }, + "required": [ + "id", + "name", + "users" + ], + "additionalProperties": false, + "definitions": { + "Id": { + "type": "string" + }, + "user.User": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "age": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "age" + ], + "additionalProperties": false + } + } +} \ 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..323665bc793 --- /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,28 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "value": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "id", + "value" + ], + "additionalProperties": false, + "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..bf9d0cf2312 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user/events_Event.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..82f512252c1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/mixed-file-directory/type_user_User.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/Id" + }, + "name": { + "type": "string" + }, + "age": { + "type": "integer" + } + }, + "required": [ + "id", + "name", + "age" + ], + "additionalProperties": false, + "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..cfbcde19d3d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/multi-line-docs/type_user_User.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "age": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..1b1dfc1efa8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials-default/type_auth_TokenResponse.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + } + }, + "required": [ + "access_token", + "expires_in" + ], + "additionalProperties": false, + "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..93c36010791 --- /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,27 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "access_token", + "expires_in" + ], + "additionalProperties": false, + "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..93c36010791 --- /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,27 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "access_token", + "expires_in" + ], + "additionalProperties": false, + "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..93c36010791 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/oauth-client-credentials/type_auth_TokenResponse.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "access_token": { + "type": "string" + }, + "expires_in": { + "type": "integer" + }, + "refresh_token": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "access_token", + "expires_in" + ], + "additionalProperties": false, + "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..e2987b7bffe --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type__Name.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "id", + "value" + ], + "additionalProperties": false, + "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..4e07ce4ce83 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/object/type__Type.json @@ -0,0 +1,171 @@ +{ + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "eighteen": { + "const": "eighteen" + }, + "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" + ], + "additionalProperties": false, + "definitions": { + "Name": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "id", + "value" + ], + "additionalProperties": false + } + } +} \ 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..fb1cf6e43fc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type__Node.json @@ -0,0 +1,59 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/commons.metadata.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "definitions": { + "commons.metadata.Metadata": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + } +} \ 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..02e171e0a36 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type__Tree.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "nodes": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/Node" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "commons.metadata.Metadata": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "Node": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/definitions/commons.metadata.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + } + } +} \ 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..808cce4d9ad --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_commons/metadata_Metadata.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "data": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..6108135cc84 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file/directory_Directory.json @@ -0,0 +1,105 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/file.File" + } + }, + { + "type": "null" + } + ] + }, + "directories": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/file.directory.Directory" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "file.directory.Directory": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "files": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/file.File" + } + }, + { + "type": "null" + } + ] + }, + "directories": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/file.directory.Directory" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..c0323f1d4e5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/objects-with-imports/type_file_File.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/file.FileInfo" + } + }, + "required": [ + "name", + "contents", + "info" + ], + "additionalProperties": false, + "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..3fff9886e2e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/package-yml/type__EchoRequest.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "required": [ + "name", + "size" + ], + "additionalProperties": false, + "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..f270aa01acd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type__UsernameCursor.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "cursor": { + "$ref": "#/definitions/UsernamePage" + } + }, + "required": [ + "cursor" + ], + "additionalProperties": false, + "definitions": { + "UsernamePage": { + "type": "object", + "properties": { + "after": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ], + "additionalProperties": false + } + } +} \ 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..ca5b95042ba --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type__UsernamePage.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "after": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "data" + ], + "additionalProperties": false, + "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..aa1cf5eb6ec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_ListUsersExtendedOptionalListResponse.json @@ -0,0 +1,64 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserOptionalListContainer" + }, + "next": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "total_count": { + "type": "integer" + } + }, + "required": [ + "data", + "total_count" + ], + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + }, + "users.UserOptionalListContainer": { + "type": "object", + "properties": { + "users": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..9d847a0b474 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_ListUsersExtendedResponse.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserListContainer" + }, + "next": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "total_count": { + "type": "integer" + } + }, + "required": [ + "data", + "total_count" + ], + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + }, + "users.UserListContainer": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "users" + ], + "additionalProperties": false + } + } +} \ 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..f066841f584 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_ListUsersPaginationResponse.json @@ -0,0 +1,103 @@ +{ + "type": "object", + "properties": { + "hasNextPage": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "page": { + "oneOf": [ + { + "$ref": "#/definitions/users.Page" + }, + { + "type": "null" + } + ] + }, + "total_count": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "total_count", + "data" + ], + "additionalProperties": false, + "definitions": { + "users.NextPage": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ], + "additionalProperties": false + }, + "users.Page": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/users.NextPage" + }, + { + "type": "null" + } + ] + }, + "per_page": { + "type": "integer" + }, + "total_page": { + "type": "integer" + } + }, + "required": [ + "page", + "per_page", + "total_page" + ], + "additionalProperties": false + }, + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + } + } +} \ 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..8514953c475 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_NextPage.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ], + "additionalProperties": false, + "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..ca6827be43f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_Page.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/users.NextPage" + }, + { + "type": "null" + } + ] + }, + "per_page": { + "type": "integer" + }, + "total_page": { + "type": "integer" + } + }, + "required": [ + "page", + "per_page", + "total_page" + ], + "additionalProperties": false, + "definitions": { + "users.NextPage": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "starting_after": { + "type": "string" + } + }, + "required": [ + "page", + "starting_after" + ], + "additionalProperties": false + } + } +} \ 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..880803ddd8d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_User.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false, + "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..c0ea26a717b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_UserListContainer.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "users" + ], + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + } + } +} \ 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..bba07264f00 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_UserOptionalListContainer.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "users": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + } + } +} \ 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..871dfeb5a4d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_UserOptionalListPage.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserOptionalListContainer" + }, + "next": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data" + ], + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + }, + "users.UserOptionalListContainer": { + "type": "object", + "properties": { + "users": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..a5e3d224afd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_UserPage.json @@ -0,0 +1,56 @@ +{ + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/users.UserListContainer" + }, + "next": { + "oneOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "data" + ], + "additionalProperties": false, + "definitions": { + "users.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "integer" + } + }, + "required": [ + "name", + "id" + ], + "additionalProperties": false + }, + "users.UserListContainer": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/users.User" + } + } + }, + "required": [ + "users" + ], + "additionalProperties": false + } + } +} \ 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..24b67fcbb39 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_UsernameContainer.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "results" + ], + "additionalProperties": false, + "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..3c9680461cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_WithCursor.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "cursor": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..1f91e9aa5b0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/pagination/type_users_WithPage.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "page": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..a2b3056427b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user_NestedUser.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "user": { + "$ref": "#/definitions/user.User" + } + }, + "required": [ + "name", + "user" + ], + "additionalProperties": false, + "definitions": { + "user.User": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "tags" + ], + "additionalProperties": false + } + } +} \ 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..ce04ebf90a7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/query-parameters/type_user_User.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "tags" + ], + "additionalProperties": false, + "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..5f38ad38445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package_Package.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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..4fbcb877237 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/reserved-keywords/type_package_Record.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "foo": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "3d": { + "type": "integer" + } + }, + "required": [ + "foo", + "3d" + ], + "additionalProperties": false, + "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..36563edb5fb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type__OptionalStringResponse.json @@ -0,0 +1,24 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/StringResponse" + }, + { + "type": "null" + } + ], + "definitions": { + "StringResponse": { + "type": "object", + "properties": { + "data": { + "type": "string" + } + }, + "required": [ + "data" + ], + "additionalProperties": false + } + } +} \ 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..5bd30ac09f0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type__StringResponse.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "data": { + "type": "string" + } + }, + "required": [ + "data" + ], + "additionalProperties": false, + "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..727ae412060 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type__WithMetadata.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "metadata" + ], + "additionalProperties": false, + "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..59aea8dcfbe --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service_Movie.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..d289f190145 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service_OptionalWithDocs.json @@ -0,0 +1,24 @@ +{ + "oneOf": [ + { + "$ref": "#/definitions/service.WithDocs" + }, + { + "type": "null" + } + ], + "definitions": { + "service.WithDocs": { + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ], + "additionalProperties": false + } + } +} \ 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..0d178b841b5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service_Response.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "docs": { + "type": "string" + }, + "data": { + "$ref": "#/definitions/service.Movie" + } + }, + "required": [ + "metadata", + "docs", + "data" + ], + "additionalProperties": false, + "definitions": { + "service.Movie": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false + } + } +} \ 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..063f21d9d3c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/response-property/type_service_WithDocs.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "docs": { + "type": "string" + } + }, + "required": [ + "docs" + ], + "additionalProperties": false, + "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..1a38226fd25 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-event-examples/type_completions_StreamedCompletion.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "delta": { + "type": "string" + }, + "tokens": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "delta" + ], + "additionalProperties": false, + "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..1a38226fd25 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/server-sent-events/type_completions_StreamedCompletion.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "delta": { + "type": "string" + }, + "tokens": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "delta" + ], + "additionalProperties": false, + "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..d2584331d98 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__Account.json @@ -0,0 +1,242 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + } + } +} \ 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..6e8cfc1d764 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__BaseResource.json @@ -0,0 +1,214 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + } + }, + "required": [ + "id", + "related_resources", + "memo" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + } + } +} \ 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..9a5c5ca11ec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__Memo.json @@ -0,0 +1,213 @@ +{ + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + } + } +} \ 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..d4ab7c5a2f9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__Patient.json @@ -0,0 +1,229 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + } + } +} \ 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..da72e210c36 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__Practitioner.json @@ -0,0 +1,222 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + } + } +} \ 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..7dd07301e71 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__ResourceList.json @@ -0,0 +1,207 @@ +{ + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ], + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + } + } +} \ 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..efc3d155a52 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/simple-fhir/type__Script.json @@ -0,0 +1,222 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false, + "definitions": { + "Memo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "account": { + "oneOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "description" + ], + "additionalProperties": false + }, + "Script": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Script" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Patient": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Patient" + }, + "name": { + "type": "string" + }, + "scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/Script" + } + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name", + "scripts" + ], + "additionalProperties": false + }, + "Practitioner": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Practitioner" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "Account": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "related_resources": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceList" + } + }, + "memo": { + "$ref": "#/definitions/Memo" + }, + "resource_type": { + "const": "Account" + }, + "name": { + "type": "string" + }, + "patient": { + "oneOf": [ + { + "$ref": "#/definitions/Patient" + }, + { + "type": "null" + } + ] + }, + "practitioner": { + "oneOf": [ + { + "$ref": "#/definitions/Practitioner" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "related_resources", + "memo", + "resource_type", + "name" + ], + "additionalProperties": false + }, + "ResourceList": { + "anyOf": [ + { + "$ref": "#/definitions/Account" + }, + { + "$ref": "#/definitions/Patient" + }, + { + "$ref": "#/definitions/Practitioner" + }, + { + "$ref": "#/definitions/Script" + } + ] + } + } +} \ 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..2cb8231306b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy_RegularResponse.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..2cb8231306b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming-parameter/type_dummy_StreamResponse.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..2cb8231306b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/streaming/type_dummy_StreamResponse.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..2634f25feba --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_BinaryTreeNodeAndTreeValue.json @@ -0,0 +1,82 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullTree": { + "$ref": "#/definitions/commons.BinaryTreeValue" + } + }, + "required": [ + "nodeId", + "fullTree" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + } + } +} \ 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..36c95785d97 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_BinaryTreeNodeValue.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false, + "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..12006095961 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_BinaryTreeValue.json @@ -0,0 +1,66 @@ +{ + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + } + } +} \ 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..898c68ff5a0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DebugKeyValuePairs.json @@ -0,0 +1,434 @@ +{ + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false, + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "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..614819a8f0e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DebugMapValue.json @@ -0,0 +1,433 @@ +{ + "type": "object", + "properties": { + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.DebugKeyValuePairs" + } + } + }, + "required": [ + "keyValuePairs" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } +} \ 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..11e686d6848 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DebugVariableValue.json @@ -0,0 +1,642 @@ +{ + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } +} \ 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..75e42694534 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DoublyLinkedListNodeAndListValue.json @@ -0,0 +1,82 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.DoublyLinkedListValue" + } + }, + "required": [ + "nodeId", + "fullList" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + } + } +} \ 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..696bd8378ec --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DoublyLinkedListNodeValue.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false, + "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..e156b02ed3b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_DoublyLinkedListValue.json @@ -0,0 +1,66 @@ +{ + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + } + } +} \ 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..6921b0f75f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_FileInfo.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false, + "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..3cd3f516108 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_GenericValue.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "stringifiedType": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "stringifiedValue" + ], + "additionalProperties": false, + "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..661baef3820 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_KeyValuePair.json @@ -0,0 +1,350 @@ +{ + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..cbb1b46c7cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_ListType.json @@ -0,0 +1,171 @@ +{ + "type": "object", + "properties": { + "valueType": { + "$ref": "#/definitions/commons.VariableType" + }, + "isFixedLength": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "valueType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..474d9a93ec4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_MapType.json @@ -0,0 +1,165 @@ +{ + "type": "object", + "properties": { + "keyType": { + "$ref": "#/definitions/commons.VariableType" + }, + "valueType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "keyType", + "valueType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..137f672da37 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_MapValue.json @@ -0,0 +1,349 @@ +{ + "type": "object", + "properties": { + "keyValuePairs": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.KeyValuePair" + } + } + }, + "required": [ + "keyValuePairs" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..26fe6b9bbc4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_SinglyLinkedListNodeAndListValue.json @@ -0,0 +1,72 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "fullList": { + "$ref": "#/definitions/commons.SinglyLinkedListValue" + } + }, + "required": [ + "nodeId", + "fullList" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + } + } +} \ 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..87e52863bc3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_SinglyLinkedListNodeValue.json @@ -0,0 +1,31 @@ +{ + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false, + "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..c881d41061f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_SinglyLinkedListValue.json @@ -0,0 +1,56 @@ +{ + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false, + "definitions": { + "commons.NodeId": { + "type": "string" + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + } + } +} \ 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..7165226bb3a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_TestCase.json @@ -0,0 +1,353 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..052a9bc218d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_TestCaseWithExpectedResult.json @@ -0,0 +1,369 @@ +{ + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..e0a0ca43c4f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_VariableType.json @@ -0,0 +1,296 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..8e39c758e8e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_commons_VariableValue.json @@ -0,0 +1,549 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..454096337de --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server_LangServerRequest.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "request": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "request" + ], + "additionalProperties": false, + "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..cfa6fd53235 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_lang-server_LangServerResponse.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "response": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "response" + ], + "additionalProperties": false, + "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..b98bbc954d5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_migration_Migration.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/migration.MigrationStatus" + } + }, + "required": [ + "name", + "status" + ], + "additionalProperties": false, + "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..29a3d2edda8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist_Playlist.json @@ -0,0 +1,38 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "problems": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.ProblemId" + } + }, + "playlist_id": { + "$ref": "#/definitions/playlist.PlaylistId" + }, + "owner-id": { + "$ref": "#/definitions/commons.UserId" + } + }, + "required": [ + "name", + "problems", + "playlist_id", + "owner-id" + ], + "additionalProperties": false, + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "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..b922c21f5ab --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist_PlaylistCreateRequest.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "problems": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.ProblemId" + } + } + }, + "required": [ + "name", + "problems" + ], + "additionalProperties": false, + "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..b922c21f5ab --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_playlist_UpdatePlaylistRequest.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "problems": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.ProblemId" + } + } + }, + "required": [ + "name", + "problems" + ], + "additionalProperties": false, + "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..569cb33028d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_CreateProblemRequest.json @@ -0,0 +1,684 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ], + "additionalProperties": false + }, + "commons.TestCaseWithExpectedResult": { + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ], + "additionalProperties": false + } + } +} \ 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..46a9afb7fda --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_GenericCreateProblemError.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + }, + "stacktrace": { + "type": "string" + } + }, + "required": [ + "message", + "type", + "stacktrace" + ], + "additionalProperties": false, + "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..1ba6814c502 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_GetDefaultStarterFilesResponse.json @@ -0,0 +1,52 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/problem.ProblemFiles" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false, + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ], + "additionalProperties": false + } + } +} \ 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..ec6521b728b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_ProblemDescription.json @@ -0,0 +1,406 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/problem.ProblemDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..41cfd56f342 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_ProblemDescriptionBoard.json @@ -0,0 +1,391 @@ +{ + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..ebacf9ef710 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_ProblemFiles.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ], + "additionalProperties": false, + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + } + } +} \ 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..9bb544d9317 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_ProblemInfo.json @@ -0,0 +1,699 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + }, + "problem.ProblemFiles": { + "type": "object", + "properties": { + "solutionFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "solutionFile", + "readOnlyFiles" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "commons.TestCase": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableValue" + } + } + }, + "required": [ + "id", + "params" + ], + "additionalProperties": false + }, + "commons.TestCaseWithExpectedResult": { + "type": "object", + "properties": { + "testCase": { + "$ref": "#/definitions/commons.TestCase" + }, + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "testCase", + "expectedResult" + ], + "additionalProperties": false + } + } +} \ 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..04712c1e095 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_UpdateProblemResponse.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "problemVersion": { + "type": "integer" + } + }, + "required": [ + "problemVersion" + ], + "additionalProperties": false, + "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..019bb9586e9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_problem_VariableTypeAndName.json @@ -0,0 +1,165 @@ +{ + "type": "object", + "properties": { + "variableType": { + "$ref": "#/definitions/commons.VariableType" + }, + "name": { + "type": "string" + } + }, + "required": [ + "variableType", + "name" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..3f520d8b1cd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ActualResult.json @@ -0,0 +1,449 @@ +{ + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..b14be4913f5 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_BuildingExecutorResponse.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "submissionId", + "status" + ], + "additionalProperties": false, + "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..7c50788f579 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_CodeExecutionUpdate.json @@ -0,0 +1,1230 @@ +{ + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "oneOf": [ + { + "$ref": "#/definitions/submission.TracedFile" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "submissionId", + "lineNumber", + "lightweightStackInfo" + ] + }, + { + "properties": { + "type": { + "const": "recorded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ], + "additionalProperties": false + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ], + "additionalProperties": false + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_CompileError.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..0c16f409b81 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_CustomTestCasesUnsupported.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "problemId", + "submissionId" + ], + "additionalProperties": false, + "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..2b7e5e202f4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ErrorInfo.json @@ -0,0 +1,82 @@ +{ + "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" + ], + "additionalProperties": false + } + } +} \ 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..74e6d634d63 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ErroredResponse.json @@ -0,0 +1,102 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "errorInfo": { + "$ref": "#/definitions/submission.ErrorInfo" + } + }, + "required": [ + "submissionId", + "errorInfo" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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..1e0c5a7d705 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ExceptionInfo.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false, + "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..c124a5f8b12 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ExecutionSessionResponse.json @@ -0,0 +1,51 @@ +{ + "type": "object", + "properties": { + "sessionId": { + "type": "string" + }, + "executionSessionUrl": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "language", + "status" + ], + "additionalProperties": false, + "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..7bba1b72c17 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ExecutionSessionState.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "lastTimeContacted": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sessionId": { + "type": "string" + }, + "isWarmInstance": { + "type": "boolean" + }, + "awsTaskId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "isWarmInstance", + "language", + "status" + ], + "additionalProperties": false, + "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..e9668def012 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ExistingSubmissionExecuting.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "additionalProperties": false, + "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..ad0e653be01 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_ExpressionLocation.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "additionalProperties": false, + "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..e9668def012 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_FinishedResponse.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "additionalProperties": false, + "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..6103dc1e124 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GetExecutionSessionStateResponse.json @@ -0,0 +1,97 @@ +{ + "type": "object", + "properties": { + "states": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.ExecutionSessionState" + } + }, + "numWarmingInstances": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "warmingSessionIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "states", + "warmingSessionIds" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sessionId": { + "type": "string" + }, + "isWarmInstance": { + "type": "boolean" + }, + "awsTaskId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "status": { + "$ref": "#/definitions/submission.ExecutionSessionStatus" + } + }, + "required": [ + "sessionId", + "isWarmInstance", + "language", + "status" + ], + "additionalProperties": false + } + } +} \ 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..beb2ed3add4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GetSubmissionStateResponse.json @@ -0,0 +1,1030 @@ +{ + "type": "object", + "properties": { + "timeSubmitted": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + }, + "submission": { + "type": "string" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionTypeState": { + "$ref": "#/definitions/submission.SubmissionTypeState" + } + }, + "required": [ + "submission", + "language", + "submissionTypeState" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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..f832ec3d37a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GetTraceResponsesPageRequest.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "offset": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..7e9dfecb220 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GradedResponse.json @@ -0,0 +1,508 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + } + } + }, + "required": [ + "submissionId", + "testCases" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + } + } +} \ 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..d9b27ff5c86 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GradedResponseV2.json @@ -0,0 +1,475 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCases": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + } + }, + "required": [ + "submissionId", + "testCases" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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..cd5a4b92a85 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_GradedTestCaseUpdate.json @@ -0,0 +1,471 @@ +{ + "type": "object", + "properties": { + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "grade": { + "$ref": "#/definitions/submission.TestCaseGrade" + } + }, + "required": [ + "testCaseId", + "grade" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.TestCaseId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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..3668ad1f6fd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_InitializeProblemRequest.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "problemId": { + "$ref": "#/definitions/commons.ProblemId" + }, + "problemVersion": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "problemId" + ], + "additionalProperties": false, + "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..fffabed8f54 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_InternalError.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "exceptionInfo": { + "$ref": "#/definitions/submission.ExceptionInfo" + } + }, + "required": [ + "exceptionInfo" + ], + "additionalProperties": false, + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false + } + } +} \ 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..625d02c748c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_InvalidRequestResponse.json @@ -0,0 +1,273 @@ +{ + "type": "object", + "properties": { + "request": { + "$ref": "#/definitions/submission.SubmissionRequest" + }, + "cause": { + "$ref": "#/definitions/submission.InvalidRequestCause" + } + }, + "required": [ + "request", + "cause" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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..46035789445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_LightweightStackframeInformation.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ], + "additionalProperties": false, + "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..45f3878f39d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_RecordedResponseNotification.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "traceResponsesSize" + ], + "additionalProperties": false, + "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..491858875fd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_RecordedTestCaseUpdate.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "testCaseId": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "testCaseId", + "traceResponsesSize" + ], + "additionalProperties": false, + "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..0d2646f1de9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_RecordingResponseNotification.json @@ -0,0 +1,78 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "testCaseId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "oneOf": [ + { + "$ref": "#/definitions/submission.TracedFile" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "lineNumber", + "lightweightStackInfo" + ], + "additionalProperties": false, + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ], + "additionalProperties": false + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false + } + } +} \ 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..4597557386c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_RunningResponse.json @@ -0,0 +1,32 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "state": { + "$ref": "#/definitions/submission.RunningSubmissionState" + } + }, + "required": [ + "submissionId", + "state" + ], + "additionalProperties": false, + "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..f50ccac10d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_RuntimeError.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ], + "additionalProperties": false, + "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..cb8f241fc2a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_Scope.json @@ -0,0 +1,433 @@ +{ + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false, + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "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..75f7f1d1b1f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StackFrame.json @@ -0,0 +1,456 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false, + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + } + } +} \ 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..23faaf4294a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StackInformation.json @@ -0,0 +1,478 @@ +{ + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "oneOf": [ + { + "$ref": "#/definitions/submission.StackFrame" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "numStackFrames" + ], + "additionalProperties": false, + "definitions": { + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false + } + } +} \ 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..ec750ed235d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StderrResponse.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "stderr": { + "type": "string" + } + }, + "required": [ + "submissionId", + "stderr" + ], + "additionalProperties": false, + "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..c6a8bc81f7a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StdoutResponse.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "submissionId", + "stdout" + ], + "additionalProperties": false, + "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..e9668def012 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StopRequest.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "additionalProperties": false, + "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..e9668def012 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_StoppedResponse.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "submissionId" + ], + "additionalProperties": false, + "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..3fb62db5e90 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionFileInfo.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "directory": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "directory", + "filename", + "contents" + ], + "additionalProperties": false, + "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..0442b827df6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionIdNotFound.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "properties": { + "missingSubmissionId": { + "$ref": "#/definitions/submission.SubmissionId" + } + }, + "required": [ + "missingSubmissionId" + ], + "additionalProperties": false, + "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..a4c118b6c0f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionRequest.json @@ -0,0 +1,189 @@ +{ + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..7f56ccb412f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionResponse.json @@ -0,0 +1,1329 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ], + "additionalProperties": false + }, + "submission.LightweightStackframeInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrameMethodName": { + "type": "string" + } + }, + "required": [ + "numStackFrames", + "topStackFrameMethodName" + ], + "additionalProperties": false + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "lineNumber": { + "type": "integer" + }, + "lightweightStackInfo": { + "$ref": "#/definitions/submission.LightweightStackframeInformation" + }, + "tracedFile": { + "oneOf": [ + { + "$ref": "#/definitions/submission.TracedFile" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type", + "submissionId", + "lineNumber", + "lightweightStackInfo" + ] + }, + { + "properties": { + "type": { + "const": "recorded" + }, + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "traceResponsesSize": { + "type": "integer" + }, + "testCaseId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "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..9c381816b68 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionStatusForTestCase.json @@ -0,0 +1,621 @@ +{ + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + } + } +} \ 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..334cdf6915f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionStatusV2.json @@ -0,0 +1,1730 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..66448620bc2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmissionTypeState.json @@ -0,0 +1,991 @@ +{ + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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..bc9d34d989d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_SubmitRequestV2.json @@ -0,0 +1,84 @@ +{ + "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": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "language", + "submissionFiles", + "problemId" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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..2b13c5c0434 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TerminatedResponse.json @@ -0,0 +1,5 @@ +{ + "type": "object", + "additionalProperties": false, + "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..7205dad5d54 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestCaseGrade.json @@ -0,0 +1,452 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..7755a527079 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestCaseHiddenGrade.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "passed": { + "type": "boolean" + } + }, + "required": [ + "passed" + ], + "additionalProperties": false, + "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..66d0c9fafd9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestCaseNonHiddenGrade.json @@ -0,0 +1,419 @@ +{ + "type": "object", + "properties": { + "passed": { + "type": "boolean" + }, + "actualResult": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "passed", + "stdout" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..f945f80ec79 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestCaseResult.json @@ -0,0 +1,469 @@ +{ + "type": "object", + "properties": { + "expectedResult": { + "$ref": "#/definitions/commons.VariableValue" + }, + "actualResult": { + "$ref": "#/definitions/submission.ActualResult" + }, + "passed": { + "type": "boolean" + } + }, + "required": [ + "expectedResult", + "actualResult", + "passed" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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..9505d7b90ae --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestCaseResultWithStdout.json @@ -0,0 +1,485 @@ +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..2a94b5b1236 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestSubmissionState.json @@ -0,0 +1,834 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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..7c0c10523f0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestSubmissionStatus.json @@ -0,0 +1,782 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "passed", + "stdout" + ] + } + ] + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + }, + "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..d709c135841 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestSubmissionStatusV2.json @@ -0,0 +1,1551 @@ +{ + "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" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.TestCaseMetadata": { + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..887f6f01d23 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestSubmissionUpdate.json @@ -0,0 +1,665 @@ +{ + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.TestSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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..9ed23058eb7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TestSubmissionUpdateInfo.json @@ -0,0 +1,648 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.VariableValue" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "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..c43395dbe16 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TraceResponse.json @@ -0,0 +1,548 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "returnValue": { + "oneOf": [ + { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + { + "type": "null" + } + ] + }, + "expressionLocation": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + { + "type": "null" + } + ] + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "lineNumber", + "stack" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "additionalProperties": false + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "oneOf": [ + { + "$ref": "#/definitions/submission.StackFrame" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "numStackFrames" + ], + "additionalProperties": false + } + } +} \ 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..c99cd4a3573 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TraceResponseV2.json @@ -0,0 +1,568 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "file": { + "$ref": "#/definitions/submission.TracedFile" + }, + "returnValue": { + "oneOf": [ + { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + { + "type": "null" + } + ] + }, + "expressionLocation": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + { + "type": "null" + } + ] + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "lineNumber", + "file", + "stack" + ], + "additionalProperties": false, + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "additionalProperties": false + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "oneOf": [ + { + "$ref": "#/definitions/submission.StackFrame" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "numStackFrames" + ], + "additionalProperties": false + } + } +} \ 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..bfa0f1eb6a3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TraceResponsesPage.json @@ -0,0 +1,573 @@ +{ + "type": "object", + "properties": { + "offset": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "traceResponses": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TraceResponse" + } + } + }, + "required": [ + "traceResponses" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "additionalProperties": false + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "oneOf": [ + { + "$ref": "#/definitions/submission.StackFrame" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "numStackFrames" + ], + "additionalProperties": false + }, + "submission.TraceResponse": { + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "returnValue": { + "oneOf": [ + { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + { + "type": "null" + } + ] + }, + "expressionLocation": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + { + "type": "null" + } + ] + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "lineNumber", + "stack" + ], + "additionalProperties": false + } + } +} \ 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..92090a304aa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TraceResponsesPageV2.json @@ -0,0 +1,593 @@ +{ + "type": "object", + "properties": { + "offset": { + "oneOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "traceResponses": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.TraceResponseV2" + } + } + }, + "required": [ + "traceResponses" + ], + "additionalProperties": false, + "definitions": { + "submission.SubmissionId": { + "type": "string", + "format": "uuid" + }, + "submission.TracedFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false + }, + "commons.DebugKeyValuePairs": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + "value": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.BinaryTreeValue": { + "type": "object", + "properties": { + "root": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListValue": { + "type": "object", + "properties": { + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "nodes" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stringifiedValue": { + "type": "string" + } + }, + "required": [ + "type", + "stringifiedValue" + ] + } + ] + }, + "submission.ExpressionLocation": { + "type": "object", + "properties": { + "start": { + "type": "integer" + }, + "offset": { + "type": "integer" + } + }, + "required": [ + "start", + "offset" + ], + "additionalProperties": false + }, + "submission.Scope": { + "type": "object", + "properties": { + "variables": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DebugVariableValue" + } + } + }, + "required": [ + "variables" + ], + "additionalProperties": false + }, + "submission.StackFrame": { + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "lineNumber": { + "type": "integer" + }, + "scopes": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.Scope" + } + } + }, + "required": [ + "methodName", + "lineNumber", + "scopes" + ], + "additionalProperties": false + }, + "submission.StackInformation": { + "type": "object", + "properties": { + "numStackFrames": { + "type": "integer" + }, + "topStackFrame": { + "oneOf": [ + { + "$ref": "#/definitions/submission.StackFrame" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "numStackFrames" + ], + "additionalProperties": false + }, + "submission.TraceResponseV2": { + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "lineNumber": { + "type": "integer" + }, + "file": { + "$ref": "#/definitions/submission.TracedFile" + }, + "returnValue": { + "oneOf": [ + { + "$ref": "#/definitions/commons.DebugVariableValue" + }, + { + "type": "null" + } + ] + }, + "expressionLocation": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExpressionLocation" + }, + { + "type": "null" + } + ] + }, + "stack": { + "$ref": "#/definitions/submission.StackInformation" + }, + "stdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "lineNumber", + "file", + "stack" + ], + "additionalProperties": false + } + } +} \ 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..4f8843da68c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TracedFile.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + } + }, + "required": [ + "filename", + "directory" + ], + "additionalProperties": false, + "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..e5b10dd955e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_TracedTestCase.json @@ -0,0 +1,501 @@ +{ + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResultWithStdout" + }, + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "result", + "traceResponsesSize" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "submission.TestCaseResultWithStdout": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/submission.TestCaseResult" + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "result", + "stdout" + ], + "additionalProperties": false + } + } +} \ 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..2d455b329d7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_UnexpectedLanguageError.json @@ -0,0 +1,26 @@ +{ + "type": "object", + "properties": { + "expectedLanguage": { + "$ref": "#/definitions/commons.Language" + }, + "actualLanguage": { + "$ref": "#/definitions/commons.Language" + } + }, + "required": [ + "expectedLanguage", + "actualLanguage" + ], + "additionalProperties": false, + "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..5e69d0902e8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceFiles.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "mainFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "mainFile", + "readOnlyFiles" + ], + "additionalProperties": false, + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + } + } +} \ 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..c1c3dde0f8e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceRanResponse.json @@ -0,0 +1,123 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "runDetails": { + "$ref": "#/definitions/submission.WorkspaceRunDetails" + } + }, + "required": [ + "submissionId", + "runDetails" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "submission.WorkspaceRunDetails": { + "type": "object", + "properties": { + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ], + "additionalProperties": false + } + } +} \ 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..a0f53dd0ffd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceRunDetails.json @@ -0,0 +1,103 @@ +{ + "type": "object", + "properties": { + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "stdout" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..d62e044fe5b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceStarterFilesResponse.json @@ -0,0 +1,52 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/submission.WorkspaceFiles" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false, + "definitions": { + "commons.FileInfo": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "contents": { + "type": "string" + } + }, + "required": [ + "filename", + "contents" + ], + "additionalProperties": false + }, + "submission.WorkspaceFiles": { + "type": "object", + "properties": { + "mainFile": { + "$ref": "#/definitions/commons.FileInfo" + }, + "readOnlyFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.FileInfo" + } + } + }, + "required": [ + "mainFile", + "readOnlyFiles" + ], + "additionalProperties": false + } + } +} \ 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..daeac146611 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceStarterFilesResponseV2.json @@ -0,0 +1,56 @@ +{ + "type": "object", + "properties": { + "filesByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.Files" + } + } + }, + "required": [ + "filesByLanguage" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + } + } +} \ 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..e62e84e10e0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmissionState.json @@ -0,0 +1,277 @@ +{ + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/submission.WorkspaceSubmissionStatus" + } + }, + "required": [ + "status" + ], + "additionalProperties": false, + "definitions": { + "submission.ExceptionInfo": { + "type": "object", + "properties": { + "exceptionType": { + "type": "string" + }, + "exceptionMessage": { + "type": "string" + }, + "exceptionStacktrace": { + "type": "string" + } + }, + "required": [ + "exceptionType", + "exceptionMessage", + "exceptionStacktrace" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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..9b9d1749411 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmissionStatus.json @@ -0,0 +1,265 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "stdout": { + "type": "string" + } + }, + "required": [ + "type", + "stdout" + ] + }, + { + "properties": { + "type": { + "const": "traced" + }, + "exceptionV2": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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..62b7ca32235 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmissionStatusV2.json @@ -0,0 +1,299 @@ +{ + "type": "object", + "properties": { + "updates": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdate" + } + } + }, + "required": [ + "updates" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..9032cc1669a --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmissionUpdate.json @@ -0,0 +1,284 @@ +{ + "type": "object", + "properties": { + "updateTime": { + "type": "string", + "format": "date-time" + }, + "updateInfo": { + "$ref": "#/definitions/submission.WorkspaceSubmissionUpdateInfo" + } + }, + "required": [ + "updateTime", + "updateInfo" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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..9645f9f1c6f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmissionUpdateInfo.json @@ -0,0 +1,267 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionV2" + }, + { + "type": "null" + } + ] + }, + "exception": { + "oneOf": [ + { + "$ref": "#/definitions/submission.ExceptionInfo" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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..f1dfe27e2de --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceSubmitRequest.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "submissionId": { + "$ref": "#/definitions/submission.SubmissionId" + }, + "language": { + "$ref": "#/definitions/commons.Language" + }, + "submissionFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/submission.SubmissionFileInfo" + } + }, + "userId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "submissionId", + "language", + "submissionFiles" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..69e7192a799 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_submission_WorkspaceTracedUpdate.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "traceResponsesSize": { + "type": "integer" + } + }, + "required": [ + "traceResponsesSize" + ], + "additionalProperties": false, + "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..28cfea89cb9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_AssertCorrectnessCheck.json @@ -0,0 +1,261 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..368cd8da8b6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_BasicCustomFiles.json @@ -0,0 +1,342 @@ +{ + "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" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..05916977137 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_BasicTestCaseTemplate.json @@ -0,0 +1,90 @@ +{ + "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" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..32e30267392 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_CreateProblemRequestV2.json @@ -0,0 +1,1152 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + }, + "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..f8b09e4773f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_CustomFiles.json @@ -0,0 +1,377 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..4d82dff157e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_DeepEqualityCorrectnessCheck.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "expectedValueParameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + } + }, + "required": [ + "expectedValueParameterId" + ], + "additionalProperties": false, + "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..6e375dc22be --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_DefaultProvidedFile.json @@ -0,0 +1,192 @@ +{ + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + }, + "relatedTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + } + } + }, + "required": [ + "file", + "relatedTypes" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..3498e193dde --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_FileInfoV2.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false, + "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..f9783c4ffd4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_Files.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + } + } +} \ 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..aee9e2dba37 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_FunctionImplementation.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false, + "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..3f8d718d4d1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_FunctionImplementationForMultipleLanguages.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + } + } +} \ 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..bb5ff15d405 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_FunctionSignature.json @@ -0,0 +1,249 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..fe744b53f12 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GeneratedFiles.json @@ -0,0 +1,70 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + } + } +} \ 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..ae8685494e1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetBasicSolutionFileRequest.json @@ -0,0 +1,207 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + } + }, + "required": [ + "methodName", + "signature" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + } + } +} \ 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..62f4b2612c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetBasicSolutionFileResponse.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "solutionFileByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "solutionFileByLanguage" + ], + "additionalProperties": false, + "definitions": { + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + } + } +} \ 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..157862e81a2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetFunctionSignatureRequest.json @@ -0,0 +1,261 @@ +{ + "type": "object", + "properties": { + "functionSignature": { + "$ref": "#/definitions/v2.problem.FunctionSignature" + } + }, + "required": [ + "functionSignature" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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..167de8aeb83 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetFunctionSignatureResponse.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "functionByLanguage": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "functionByLanguage" + ], + "additionalProperties": false, + "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..e94d71abebb --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetGeneratedTestCaseFileRequest.json @@ -0,0 +1,923 @@ +{ + "type": "object", + "properties": { + "template": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + }, + { + "type": "null" + } + ] + }, + "testCase": { + "$ref": "#/definitions/v2.problem.TestCaseV2" + } + }, + "required": [ + "testCase" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + } + } +} \ 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..af74b58d999 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_GetGeneratedTestCaseTemplateFileRequest.json @@ -0,0 +1,461 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.problem.TestCaseTemplate" + } + }, + "required": [ + "template" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..05f422addb2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_LightweightProblemInfoV2.json @@ -0,0 +1,180 @@ +{ + "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" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..5fa7bab8214 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_NonVoidFunctionDefinition.json @@ -0,0 +1,244 @@ +{ + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..cc53fc34005 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_NonVoidFunctionSignature.json @@ -0,0 +1,191 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..cc5d1111d7d --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_Parameter.json @@ -0,0 +1,172 @@ +{ + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..725d20ab912 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_ProblemInfoV2.json @@ -0,0 +1,1196 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + } + } +} \ 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..5d5874e533b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseExpects.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "expectedStdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..0c5dd9b73a0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseFunction.json @@ -0,0 +1,352 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..9ff021f77c6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseImplementation.json @@ -0,0 +1,426 @@ +{ + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..153f6bc3234 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseImplementationDescription.json @@ -0,0 +1,63 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "additionalProperties": false, + "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..07dfea1f00e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseImplementationReference.json @@ -0,0 +1,461 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..166e2b82653 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseMetadata.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "additionalProperties": false, + "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..065c4131f41 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseTemplate.json @@ -0,0 +1,449 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..19410861cde --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseV2.json @@ -0,0 +1,865 @@ +{ + "type": "object", + "properties": { + "metadata": { + "$ref": "#/definitions/v2.problem.TestCaseMetadata" + }, + "implementation": { + "$ref": "#/definitions/v2.problem.TestCaseImplementationReference" + }, + "arguments": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "expects": { + "oneOf": [ + { + "$ref": "#/definitions/v2.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.DoublyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "nullValue" + } + }, + "required": [ + "type" + ] + } + ] + }, + "v2.problem.TestCaseExpects": { + "type": "object", + "properties": { + "expectedStdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..dc80826f9a3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_TestCaseWithActualResultImplementation.json @@ -0,0 +1,312 @@ +{ + "type": "object", + "properties": { + "getActualResult": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "getActualResult", + "assertCorrectnessCheck" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionSignature": { + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..f02ee71d4b9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_VoidFunctionDefinition.json @@ -0,0 +1,228 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "parameters", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..bf58c00bad4 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_VoidFunctionDefinitionThatTakesActualResult.json @@ -0,0 +1,228 @@ +{ + "type": "object", + "properties": { + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "additionalParameters", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..3610ddca6d2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_VoidFunctionSignature.json @@ -0,0 +1,187 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + } + }, + "required": [ + "parameters" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..a4246c9cee6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/problem_VoidFunctionSignatureThatTakesActualResult.json @@ -0,0 +1,191 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "actualResultType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..a6fc0ec0cc7 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_AssertCorrectnessCheck.json @@ -0,0 +1,261 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..7f301ce8fdf --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_BasicCustomFiles.json @@ -0,0 +1,342 @@ +{ + "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" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..4678a8ff7b0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_BasicTestCaseTemplate.json @@ -0,0 +1,90 @@ +{ + "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" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..7517c826a19 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_CreateProblemRequestV2.json @@ -0,0 +1,1152 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + }, + "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..149f14f1bfa --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_CustomFiles.json @@ -0,0 +1,377 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..0e8a221104f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_DeepEqualityCorrectnessCheck.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "expectedValueParameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + } + }, + "required": [ + "expectedValueParameterId" + ], + "additionalProperties": false, + "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..9be106fa7f6 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_DefaultProvidedFile.json @@ -0,0 +1,192 @@ +{ + "type": "object", + "properties": { + "file": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + }, + "relatedTypes": { + "type": "array", + "items": { + "$ref": "#/definitions/commons.VariableType" + } + } + }, + "required": [ + "file", + "relatedTypes" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..3498e193dde --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_FileInfoV2.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false, + "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..a50b2730f31 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_Files.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..aee9e2dba37 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_FunctionImplementation.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false, + "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..584d5695c05 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_FunctionImplementationForMultipleLanguages.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false, + "definitions": { + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + } + } +} \ 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..abe0cbdb2f3 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_FunctionSignature.json @@ -0,0 +1,249 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..0e4ff06e605 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GeneratedFiles.json @@ -0,0 +1,70 @@ +{ + "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" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + } + } +} \ 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..ff2dcd9ce63 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetBasicSolutionFileRequest.json @@ -0,0 +1,207 @@ +{ + "type": "object", + "properties": { + "methodName": { + "type": "string" + }, + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + } + }, + "required": [ + "methodName", + "signature" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..e1435d3ffe0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetBasicSolutionFileResponse.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "solutionFileByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "solutionFileByLanguage" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + } + } +} \ 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..4e8ade7b3f0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetFunctionSignatureRequest.json @@ -0,0 +1,261 @@ +{ + "type": "object", + "properties": { + "functionSignature": { + "$ref": "#/definitions/v2.v3.problem.FunctionSignature" + } + }, + "required": [ + "functionSignature" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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..167de8aeb83 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetFunctionSignatureResponse.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "functionByLanguage": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "functionByLanguage" + ], + "additionalProperties": false, + "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..97211f91712 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetGeneratedTestCaseFileRequest.json @@ -0,0 +1,923 @@ +{ + "type": "object", + "properties": { + "template": { + "oneOf": [ + { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + }, + { + "type": "null" + } + ] + }, + "testCase": { + "$ref": "#/definitions/v2.v3.problem.TestCaseV2" + } + }, + "required": [ + "testCase" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + } + } +} \ 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..52b76329a3f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_GetGeneratedTestCaseTemplateFileRequest.json @@ -0,0 +1,461 @@ +{ + "type": "object", + "properties": { + "template": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplate" + } + }, + "required": [ + "template" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..05f422addb2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_LightweightProblemInfoV2.json @@ -0,0 +1,180 @@ +{ + "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" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..65ca975681e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_NonVoidFunctionDefinition.json @@ -0,0 +1,244 @@ +{ + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..a432bd2b15e --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_NonVoidFunctionSignature.json @@ -0,0 +1,191 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "returnType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "returnType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..6af4dd2d752 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_Parameter.json @@ -0,0 +1,172 @@ +{ + "type": "object", + "properties": { + "parameterId": { + "$ref": "#/definitions/v2.v3.problem.ParameterId" + }, + "name": { + "type": "string" + }, + "variableType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameterId", + "name", + "variableType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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..2b0d4aaa775 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_ProblemInfoV2.json @@ -0,0 +1,1196 @@ +{ + "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" + ], + "additionalProperties": false, + "definitions": { + "commons.ProblemId": { + "type": "string" + }, + "commons.KeyValuePair": { + "type": "object", + "properties": { + "key": { + "$ref": "#/definitions/commons.VariableValue" + }, + "value": { + "$ref": "#/definitions/commons.VariableValue" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FileInfoV2": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "directory": { + "type": "string" + }, + "contents": { + "type": "string" + }, + "editable": { + "type": "boolean" + } + }, + "required": [ + "filename", + "directory", + "contents", + "editable" + ], + "additionalProperties": false + }, + "v2.v3.problem.Files": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.FileInfoV2" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false + } + } +} \ 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..5d5874e533b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseExpects.json @@ -0,0 +1,17 @@ +{ + "type": "object", + "properties": { + "expectedStdout": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "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..c2c5cb96e33 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseFunction.json @@ -0,0 +1,352 @@ +{ + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..4fe976a2cdc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseImplementation.json @@ -0,0 +1,426 @@ +{ + "type": "object", + "properties": { + "description": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescription" + }, + "function": { + "$ref": "#/definitions/v2.v3.problem.TestCaseFunction" + } + }, + "required": [ + "description", + "function" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..6d36e7ee2a0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseImplementationDescription.json @@ -0,0 +1,63 @@ +{ + "type": "object", + "properties": { + "boards": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementationDescriptionBoard" + } + } + }, + "required": [ + "boards" + ], + "additionalProperties": false, + "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..39889b47fc8 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseImplementationReference.json @@ -0,0 +1,461 @@ +{ + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..44591126392 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseMetadata.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/v2.v3.problem.TestCaseId" + }, + "name": { + "type": "string" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "id", + "name", + "hidden" + ], + "additionalProperties": false, + "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..d5de70da228 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseTemplate.json @@ -0,0 +1,449 @@ +{ + "type": "object", + "properties": { + "templateId": { + "$ref": "#/definitions/v2.v3.problem.TestCaseTemplateId" + }, + "name": { + "type": "string" + }, + "implementation": { + "$ref": "#/definitions/v2.v3.problem.TestCaseImplementation" + } + }, + "required": [ + "templateId", + "name", + "implementation" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..3ec680a85cc --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseV2.json @@ -0,0 +1,865 @@ +{ + "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": { + "oneOf": [ + { + "$ref": "#/definitions/v2.v3.problem.TestCaseExpects" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "metadata", + "implementation", + "arguments" + ], + "additionalProperties": false, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "commons.NodeId": { + "type": "string" + }, + "commons.BinaryTreeNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "right": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "left": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.SinglyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "commons.DoublyLinkedListNodeValue": { + "type": "object", + "properties": { + "nodeId": { + "$ref": "#/definitions/commons.NodeId" + }, + "val": { + "type": "number" + }, + "next": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "prev": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "nodeId", + "val" + ], + "additionalProperties": false + }, + "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": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.BinaryTreeNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "singlyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "nodes": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/commons.SinglyLinkedListNodeValue" + } + } + }, + "required": [ + "type", + "nodes" + ] + }, + { + "properties": { + "type": { + "const": "doublyLinkedListValue" + }, + "head": { + "oneOf": [ + { + "$ref": "#/definitions/commons.NodeId" + }, + { + "type": "null" + } + ] + }, + "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": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false + } + } +} \ 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..9bcb59010d1 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_TestCaseWithActualResultImplementation.json @@ -0,0 +1,312 @@ +{ + "type": "object", + "properties": { + "getActualResult": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionDefinition" + }, + "assertCorrectnessCheck": { + "$ref": "#/definitions/v2.v3.problem.AssertCorrectnessCheck" + } + }, + "required": [ + "getActualResult", + "assertCorrectnessCheck" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + }, + "v2.v3.problem.NonVoidFunctionDefinition": { + "type": "object", + "properties": { + "signature": { + "$ref": "#/definitions/v2.v3.problem.NonVoidFunctionSignature" + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "signature", + "code" + ], + "additionalProperties": false + }, + "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..6a44b1a88b9 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_VoidFunctionDefinition.json @@ -0,0 +1,228 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "parameters", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..99c915c31b2 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_VoidFunctionDefinitionThatTakesActualResult.json @@ -0,0 +1,228 @@ +{ + "type": "object", + "properties": { + "additionalParameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "code": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementationForMultipleLanguages" + } + }, + "required": [ + "additionalParameters", + "code" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementation": { + "type": "object", + "properties": { + "impl": { + "type": "string" + }, + "imports": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "impl" + ], + "additionalProperties": false + }, + "v2.v3.problem.FunctionImplementationForMultipleLanguages": { + "type": "object", + "properties": { + "codeByLanguage": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/v2.v3.problem.FunctionImplementation" + } + } + }, + "required": [ + "codeByLanguage" + ], + "additionalProperties": false + } + } +} \ 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..f92c95abe3c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_VoidFunctionSignature.json @@ -0,0 +1,187 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + } + }, + "required": [ + "parameters" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..3d9defb6405 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/trace/type_v2/v3/problem_VoidFunctionSignatureThatTakesActualResult.json @@ -0,0 +1,191 @@ +{ + "type": "object", + "properties": { + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/v2.v3.problem.Parameter" + } + }, + "actualResultType": { + "$ref": "#/definitions/commons.VariableType" + } + }, + "required": [ + "parameters", + "actualResultType" + ], + "additionalProperties": false, + "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": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "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" + ], + "additionalProperties": false + } + } +} \ 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..7efcc3b44b0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/ts-express-casing/type_imdb_Movie.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/imdb.MovieId" + }, + "title": { + "type": "string" + }, + "rating": { + "type": "number" + } + }, + "required": [ + "id", + "title", + "rating" + ], + "additionalProperties": false, + "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..09bc591b42c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union_Key.json @@ -0,0 +1,19 @@ +{ + "anyOf": [ + { + "$ref": "#/definitions/union.KeyType" + }, + { + "const": "default" + } + ], + "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..a4e39d94fe0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union_MyUnion.json @@ -0,0 +1,39 @@ +{ + "anyOf": [ + { + "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..dbde05a5dd0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/undiscriminated-unions/type_union_TypeWithOptionalUnion.json @@ -0,0 +1,56 @@ +{ + "type": "object", + "properties": { + "myUnion": { + "oneOf": [ + { + "$ref": "#/definitions/union.MyUnion" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "union.MyUnion": { + "anyOf": [ + { + "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..5f38ad38445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_Bar.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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..5f38ad38445 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_Foo.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "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..5e324a0ae6c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_Union.json @@ -0,0 +1,69 @@ +{ + "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" + ], + "additionalProperties": false + }, + "types.Bar": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..7f70733d0bd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_UnionWithDiscriminant.json @@ -0,0 +1,69 @@ +{ + "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" + ], + "additionalProperties": false + }, + "types.Bar": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + } +} \ 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..83068ac6533 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_UnionWithLiteral.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "fern" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "fern" + }, + "value": { + "const": "fern" + } + }, + "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..b826b4b5dbe --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_types_UnionWithOptionalTime.json @@ -0,0 +1,60 @@ +{ + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "date", + "dateimte" + ] + } + }, + "required": [ + "type" + ], + "oneOf": [ + { + "properties": { + "type": { + "const": "date" + }, + "value": { + "oneOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type" + ] + }, + { + "properties": { + "type": { + "const": "dateimte" + }, + "value": { + "oneOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ] + } + }, + "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..d96336006c0 --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union_Circle.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "radius": { + "type": "number" + } + }, + "required": [ + "radius" + ], + "additionalProperties": false, + "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..d352068bd6b --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union_GetShapeRequest.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "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..d7f31791eed --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unions/type_union_Square.json @@ -0,0 +1,13 @@ +{ + "type": "object", + "properties": { + "length": { + "type": "number" + } + }, + "required": [ + "length" + ], + "additionalProperties": false, + "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..e8a1fdd625c --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/unknown/type_unknown_MyObject.json @@ -0,0 +1,20 @@ +{ + "type": "object", + "properties": { + "unknown": { + "type": [ + "string", + "number", + "boolean", + "object", + "array", + "null" + ] + } + }, + "required": [ + "unknown" + ], + "additionalProperties": false, + "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..1ff6744b2cd --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/validation/type__Type.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "properties": { + "decimal": { + "type": "number" + }, + "even": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "shape": { + "$ref": "#/definitions/Shape" + } + }, + "required": [ + "decimal", + "even", + "name", + "shape" + ], + "additionalProperties": false, + "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..c9e022e743f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version-no-default/type_user_User.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/user.UserId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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..c9e022e743f --- /dev/null +++ b/packages/cli/fern-definition/ir-to-jsonschema/src/__test__/__snapshots__/version/type_user_User.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "id": { + "$ref": "#/definitions/user.UserId" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "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 index 3bc3f92ae62..1044f0d1f94 100644 --- 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 @@ -57,7 +57,9 @@ describe("convertIRtoJsonSchema", async () => { const json = JSON.stringify(jsonschema, undefined, 2); // eslint-disable-next-line jest/no-standalone-expect await expect(json).toMatchFileSnapshot( - RelativeFilePath.of(`./__snapshots__/${workspace.workspaceName}/${typeId}.json`) + RelativeFilePath.of( + `./__snapshots__/${workspace.workspaceName}/${typeId.replaceAll(":", "_")}.json` + ) ); }); } diff --git a/packages/cli/mock/src/runMockServer.ts b/packages/cli/mock/src/runMockServer.ts index b2433265357..1771f8b7da4 100644 --- a/packages/cli/mock/src/runMockServer.ts +++ b/packages/cli/mock/src/runMockServer.ts @@ -229,7 +229,7 @@ function getRequestHandler(endpoints: HttpEndpoint[]): RequestHandler { return; } res.status(404).send({ - message: `Failed to match request with example`, + message: "Failed to match request with example", request: { url: req.url, headers: req.headers,