diff --git a/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/baseline-sdks/v3-nested-inline-objects-audiences.json b/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/baseline-sdks/v3-nested-inline-objects-audiences.json new file mode 100644 index 000000000000..a56534f7f464 --- /dev/null +++ b/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/baseline-sdks/v3-nested-inline-objects-audiences.json @@ -0,0 +1,2284 @@ +{ + "selfHosted": false, + "apiName": "api", + "apiDisplayName": "Nested object audience-filtering regression fixture", + "auth": { + "requirement": "ALL", + "schemes": [] + }, + "headers": [], + "idempotencyHeaders": [], + "types": { + "type_:ItemResponse": { + "name": { + "name": "ItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponse" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "object", + "valueType": { + "container": { + "optional": { + "name": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ItemResponseObjectType": { + "inline": true, + "name": { + "name": "ItemResponseObjectType", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObjectType" + }, + "shape": { + "values": [ + { + "name": "item" + } + ], + "type": "enum" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ItemResponseObjectData": { + "inline": true, + "name": { + "name": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObjectData" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "id", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "docs": "The name of the item.", + "name": "name", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "docs": "The price in cents.", + "name": "price_cents", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "INTEGER", + "v2": { + "type": "integer" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "docs": "Internal-only field; scrubbed from the public audience.", + "name": "internal_field", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ItemResponseObject": { + "name": { + "name": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObject" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "type", + "valueType": { + "container": { + "optional": { + "name": "ItemResponseObjectType", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObjectType", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "name": "data", + "valueType": { + "container": { + "optional": { + "name": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponseObjectData", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:DeepItemResponse": { + "name": { + "name": "DeepItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponse" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "body", + "valueType": { + "container": { + "optional": { + "name": "DeepItemResponseBody", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseBody", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:DeepItemResponseBody": { + "name": { + "name": "DeepItemResponseBody", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseBody" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "object", + "valueType": { + "container": { + "optional": { + "name": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:DeepItemResponseObjectKind": { + "inline": true, + "name": { + "name": "DeepItemResponseObjectKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObjectKind" + }, + "shape": { + "values": [ + { + "name": { + "wireValue": "deep-item", + "name": "DeepItem" + } + } + ], + "type": "enum" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:DeepItemResponseObjectPayload": { + "inline": true, + "name": { + "name": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObjectPayload" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "uuid", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "name": "label", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:DeepItemResponseObject": { + "name": { + "name": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObject" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "kind", + "valueType": { + "container": { + "optional": { + "name": "DeepItemResponseObjectKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObjectKind", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "name": "payload", + "valueType": { + "container": { + "optional": { + "name": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponseObjectPayload", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ListResponseKind": { + "inline": true, + "name": { + "name": "ListResponseKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseKind" + }, + "shape": { + "values": [ + { + "name": "list" + } + ], + "type": "enum" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ListResponse": { + "name": { + "name": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponse" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "kind", + "valueType": { + "container": { + "optional": { + "name": "ListResponseKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseKind", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "name": "items", + "valueType": { + "container": { + "optional": { + "container": { + "list": { + "name": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItem", + "type": "named" + }, + "type": "list" + }, + "type": "container" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ListResponseItemMetaTag": { + "inline": true, + "name": { + "name": "ListResponseItemMetaTag", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItemMetaTag" + }, + "shape": { + "values": [ + { + "name": "alpha" + }, + { + "name": "beta" + } + ], + "type": "enum" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ListResponseItemMeta": { + "inline": true, + "name": { + "name": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItemMeta" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "tag", + "valueType": { + "container": { + "optional": { + "name": "ListResponseItemMetaTag", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItemMetaTag", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + }, + "type_:ListResponseItem": { + "name": { + "name": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItem" + }, + "shape": { + "extends": [], + "properties": [ + { + "name": "id", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + }, + { + "name": "meta", + "valueType": { + "container": { + "optional": { + "name": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponseItemMeta", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": {} + } + } + ], + "extraProperties": false, + "extendedProperties": [], + "type": "object" + }, + "referencedTypes": {}, + "encoding": { + "json": {} + }, + "userProvidedExamples": [], + "autogeneratedExamples": [] + } + }, + "errors": {}, + "services": { + "service_": { + "name": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "basePath": { + "head": "", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "encoding": { + "json": {} + }, + "transport": { + "type": "http" + }, + "endpoints": [ + { + "id": "endpoint_.getItem", + "name": "getItem", + "auth": false, + "idempotent": false, + "method": "GET", + "path": { + "head": "/items", + "parts": [] + }, + "fullPath": { + "head": "items", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "response": { + "body": { + "value": { + "docs": "ok", + "responseBodyType": { + "name": "ItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ItemResponse", + "type": "named" + }, + "type": "response" + }, + "type": "json" + }, + "statusCode": 200, + "docs": "ok" + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "audiences": [ + "public" + ], + "responseHeaders": [] + }, + { + "id": "endpoint_.getItemDeep", + "name": "getItemDeep", + "auth": false, + "idempotent": false, + "method": "GET", + "path": { + "head": "/items/deep", + "parts": [] + }, + "fullPath": { + "head": "items/deep", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "response": { + "body": { + "value": { + "docs": "ok", + "responseBodyType": { + "name": "DeepItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:DeepItemResponse", + "type": "named" + }, + "type": "response" + }, + "type": "json" + }, + "statusCode": 200, + "docs": "ok" + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "audiences": [ + "public" + ], + "responseHeaders": [] + }, + { + "id": "endpoint_.getList", + "name": "getList", + "auth": false, + "idempotent": false, + "method": "GET", + "path": { + "head": "/lists", + "parts": [] + }, + "fullPath": { + "head": "lists", + "parts": [] + }, + "pathParameters": [], + "allPathParameters": [], + "queryParameters": [], + "headers": [], + "response": { + "body": { + "value": { + "docs": "ok", + "responseBodyType": { + "name": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "typeId": "type_:ListResponse", + "type": "named" + }, + "type": "response" + }, + "type": "json" + }, + "statusCode": 200, + "docs": "ok" + }, + "errors": [], + "userSpecifiedExamples": [], + "autogeneratedExamples": [], + "audiences": [ + "public" + ], + "responseHeaders": [] + } + ] + } + }, + "constants": { + "errorInstanceIdKey": "errorInstanceId" + }, + "environments": { + "defaultEnvironment": "Default", + "environments": { + "environments": [ + { + "id": "Default", + "name": "Default", + "url": "https://api.example.com" + } + ], + "type": "singleBaseUrl" + } + }, + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "pathParameters": [], + "variables": [], + "serviceTypeReferenceInfo": { + "typesReferencedOnlyByService": { + "service_": [ + "type_:ItemResponse", + "type_:ItemResponseObjectType", + "type_:ItemResponseObjectData", + "type_:ItemResponseObject", + "type_:DeepItemResponse", + "type_:DeepItemResponseBody", + "type_:DeepItemResponseObjectKind", + "type_:DeepItemResponseObjectPayload", + "type_:DeepItemResponseObject", + "type_:ListResponseKind", + "type_:ListResponse", + "type_:ListResponseItemMetaTag", + "type_:ListResponseItemMeta", + "type_:ListResponseItem" + ] + }, + "sharedTypes": [] + }, + "webhookGroups": {}, + "websocketChannels": {}, + "dynamic": { + "version": "1.0.0", + "types": { + "type_:ItemResponse": { + "declaration": { + "name": { + "originalName": "ItemResponse", + "camelCase": { + "unsafeName": "itemResponse", + "safeName": "itemResponse" + }, + "snakeCase": { + "unsafeName": "item_response", + "safeName": "item_response" + }, + "screamingSnakeCase": { + "unsafeName": "ITEM_RESPONSE", + "safeName": "ITEM_RESPONSE" + }, + "pascalCase": { + "unsafeName": "ItemResponse", + "safeName": "ItemResponse" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "object", + "name": { + "originalName": "object", + "camelCase": { + "unsafeName": "object", + "safeName": "object" + }, + "snakeCase": { + "unsafeName": "object", + "safeName": "object" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT", + "safeName": "OBJECT" + }, + "pascalCase": { + "unsafeName": "Object", + "safeName": "Object" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ItemResponseObject", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:ItemResponseObjectType": { + "declaration": { + "name": { + "originalName": "ItemResponseObjectType", + "camelCase": { + "unsafeName": "itemResponseObjectType", + "safeName": "itemResponseObjectType" + }, + "snakeCase": { + "unsafeName": "item_response_object_type", + "safeName": "item_response_object_type" + }, + "screamingSnakeCase": { + "unsafeName": "ITEM_RESPONSE_OBJECT_TYPE", + "safeName": "ITEM_RESPONSE_OBJECT_TYPE" + }, + "pascalCase": { + "unsafeName": "ItemResponseObjectType", + "safeName": "ItemResponseObjectType" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "values": [ + { + "wireValue": "item", + "name": { + "originalName": "item", + "camelCase": { + "unsafeName": "item", + "safeName": "item" + }, + "snakeCase": { + "unsafeName": "item", + "safeName": "item" + }, + "screamingSnakeCase": { + "unsafeName": "ITEM", + "safeName": "ITEM" + }, + "pascalCase": { + "unsafeName": "Item", + "safeName": "Item" + } + } + } + ], + "type": "enum" + }, + "type_:ItemResponseObjectData": { + "declaration": { + "name": { + "originalName": "ItemResponseObjectData", + "camelCase": { + "unsafeName": "itemResponseObjectData", + "safeName": "itemResponseObjectData" + }, + "snakeCase": { + "unsafeName": "item_response_object_data", + "safeName": "item_response_object_data" + }, + "screamingSnakeCase": { + "unsafeName": "ITEM_RESPONSE_OBJECT_DATA", + "safeName": "ITEM_RESPONSE_OBJECT_DATA" + }, + "pascalCase": { + "unsafeName": "ItemResponseObjectData", + "safeName": "ItemResponseObjectData" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "id", + "name": { + "originalName": "id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "ID", + "safeName": "ID" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "name", + "name": { + "originalName": "name", + "camelCase": { + "unsafeName": "name", + "safeName": "name" + }, + "snakeCase": { + "unsafeName": "name", + "safeName": "name" + }, + "screamingSnakeCase": { + "unsafeName": "NAME", + "safeName": "NAME" + }, + "pascalCase": { + "unsafeName": "Name", + "safeName": "Name" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "price_cents", + "name": { + "originalName": "price_cents", + "camelCase": { + "unsafeName": "priceCents", + "safeName": "priceCents" + }, + "snakeCase": { + "unsafeName": "price_cents", + "safeName": "price_cents" + }, + "screamingSnakeCase": { + "unsafeName": "PRICE_CENTS", + "safeName": "PRICE_CENTS" + }, + "pascalCase": { + "unsafeName": "PriceCents", + "safeName": "PriceCents" + } + } + }, + "typeReference": { + "value": { + "value": "INTEGER", + "type": "primitive" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "internal_field", + "name": { + "originalName": "internal_field", + "camelCase": { + "unsafeName": "internalField", + "safeName": "internalField" + }, + "snakeCase": { + "unsafeName": "internal_field", + "safeName": "internal_field" + }, + "screamingSnakeCase": { + "unsafeName": "INTERNAL_FIELD", + "safeName": "INTERNAL_FIELD" + }, + "pascalCase": { + "unsafeName": "InternalField", + "safeName": "InternalField" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:ItemResponseObject": { + "declaration": { + "name": { + "originalName": "ItemResponseObject", + "camelCase": { + "unsafeName": "itemResponseObject", + "safeName": "itemResponseObject" + }, + "snakeCase": { + "unsafeName": "item_response_object", + "safeName": "item_response_object" + }, + "screamingSnakeCase": { + "unsafeName": "ITEM_RESPONSE_OBJECT", + "safeName": "ITEM_RESPONSE_OBJECT" + }, + "pascalCase": { + "unsafeName": "ItemResponseObject", + "safeName": "ItemResponseObject" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "type", + "name": { + "originalName": "type", + "camelCase": { + "unsafeName": "type", + "safeName": "type" + }, + "snakeCase": { + "unsafeName": "type", + "safeName": "type" + }, + "screamingSnakeCase": { + "unsafeName": "TYPE", + "safeName": "TYPE" + }, + "pascalCase": { + "unsafeName": "Type", + "safeName": "Type" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ItemResponseObjectType", + "type": "named" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "data", + "name": { + "originalName": "data", + "camelCase": { + "unsafeName": "data", + "safeName": "data" + }, + "snakeCase": { + "unsafeName": "data", + "safeName": "data" + }, + "screamingSnakeCase": { + "unsafeName": "DATA", + "safeName": "DATA" + }, + "pascalCase": { + "unsafeName": "Data", + "safeName": "Data" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ItemResponseObjectData", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:DeepItemResponse": { + "declaration": { + "name": { + "originalName": "DeepItemResponse", + "camelCase": { + "unsafeName": "deepItemResponse", + "safeName": "deepItemResponse" + }, + "snakeCase": { + "unsafeName": "deep_item_response", + "safeName": "deep_item_response" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM_RESPONSE", + "safeName": "DEEP_ITEM_RESPONSE" + }, + "pascalCase": { + "unsafeName": "DeepItemResponse", + "safeName": "DeepItemResponse" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "body", + "name": { + "originalName": "body", + "camelCase": { + "unsafeName": "body", + "safeName": "body" + }, + "snakeCase": { + "unsafeName": "body", + "safeName": "body" + }, + "screamingSnakeCase": { + "unsafeName": "BODY", + "safeName": "BODY" + }, + "pascalCase": { + "unsafeName": "Body", + "safeName": "Body" + } + } + }, + "typeReference": { + "value": { + "value": "type_:DeepItemResponseBody", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:DeepItemResponseBody": { + "declaration": { + "name": { + "originalName": "DeepItemResponseBody", + "camelCase": { + "unsafeName": "deepItemResponseBody", + "safeName": "deepItemResponseBody" + }, + "snakeCase": { + "unsafeName": "deep_item_response_body", + "safeName": "deep_item_response_body" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM_RESPONSE_BODY", + "safeName": "DEEP_ITEM_RESPONSE_BODY" + }, + "pascalCase": { + "unsafeName": "DeepItemResponseBody", + "safeName": "DeepItemResponseBody" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "object", + "name": { + "originalName": "object", + "camelCase": { + "unsafeName": "object", + "safeName": "object" + }, + "snakeCase": { + "unsafeName": "object", + "safeName": "object" + }, + "screamingSnakeCase": { + "unsafeName": "OBJECT", + "safeName": "OBJECT" + }, + "pascalCase": { + "unsafeName": "Object", + "safeName": "Object" + } + } + }, + "typeReference": { + "value": { + "value": "type_:DeepItemResponseObject", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:DeepItemResponseObjectKind": { + "declaration": { + "name": { + "originalName": "DeepItemResponseObjectKind", + "camelCase": { + "unsafeName": "deepItemResponseObjectKind", + "safeName": "deepItemResponseObjectKind" + }, + "snakeCase": { + "unsafeName": "deep_item_response_object_kind", + "safeName": "deep_item_response_object_kind" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM_RESPONSE_OBJECT_KIND", + "safeName": "DEEP_ITEM_RESPONSE_OBJECT_KIND" + }, + "pascalCase": { + "unsafeName": "DeepItemResponseObjectKind", + "safeName": "DeepItemResponseObjectKind" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "values": [ + { + "wireValue": "deep-item", + "name": { + "originalName": "DeepItem", + "camelCase": { + "unsafeName": "deepItem", + "safeName": "deepItem" + }, + "snakeCase": { + "unsafeName": "deep_item", + "safeName": "deep_item" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM", + "safeName": "DEEP_ITEM" + }, + "pascalCase": { + "unsafeName": "DeepItem", + "safeName": "DeepItem" + } + } + } + ], + "type": "enum" + }, + "type_:DeepItemResponseObjectPayload": { + "declaration": { + "name": { + "originalName": "DeepItemResponseObjectPayload", + "camelCase": { + "unsafeName": "deepItemResponseObjectPayload", + "safeName": "deepItemResponseObjectPayload" + }, + "snakeCase": { + "unsafeName": "deep_item_response_object_payload", + "safeName": "deep_item_response_object_payload" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM_RESPONSE_OBJECT_PAYLOAD", + "safeName": "DEEP_ITEM_RESPONSE_OBJECT_PAYLOAD" + }, + "pascalCase": { + "unsafeName": "DeepItemResponseObjectPayload", + "safeName": "DeepItemResponseObjectPayload" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "uuid", + "name": { + "originalName": "uuid", + "camelCase": { + "unsafeName": "uuid", + "safeName": "uuid" + }, + "snakeCase": { + "unsafeName": "uuid", + "safeName": "uuid" + }, + "screamingSnakeCase": { + "unsafeName": "UUID", + "safeName": "UUID" + }, + "pascalCase": { + "unsafeName": "UUID", + "safeName": "UUID" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "label", + "name": { + "originalName": "label", + "camelCase": { + "unsafeName": "label", + "safeName": "label" + }, + "snakeCase": { + "unsafeName": "label", + "safeName": "label" + }, + "screamingSnakeCase": { + "unsafeName": "LABEL", + "safeName": "LABEL" + }, + "pascalCase": { + "unsafeName": "Label", + "safeName": "Label" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:DeepItemResponseObject": { + "declaration": { + "name": { + "originalName": "DeepItemResponseObject", + "camelCase": { + "unsafeName": "deepItemResponseObject", + "safeName": "deepItemResponseObject" + }, + "snakeCase": { + "unsafeName": "deep_item_response_object", + "safeName": "deep_item_response_object" + }, + "screamingSnakeCase": { + "unsafeName": "DEEP_ITEM_RESPONSE_OBJECT", + "safeName": "DEEP_ITEM_RESPONSE_OBJECT" + }, + "pascalCase": { + "unsafeName": "DeepItemResponseObject", + "safeName": "DeepItemResponseObject" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "kind", + "name": { + "originalName": "kind", + "camelCase": { + "unsafeName": "kind", + "safeName": "kind" + }, + "snakeCase": { + "unsafeName": "kind", + "safeName": "kind" + }, + "screamingSnakeCase": { + "unsafeName": "KIND", + "safeName": "KIND" + }, + "pascalCase": { + "unsafeName": "Kind", + "safeName": "Kind" + } + } + }, + "typeReference": { + "value": { + "value": "type_:DeepItemResponseObjectKind", + "type": "named" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "payload", + "name": { + "originalName": "payload", + "camelCase": { + "unsafeName": "payload", + "safeName": "payload" + }, + "snakeCase": { + "unsafeName": "payload", + "safeName": "payload" + }, + "screamingSnakeCase": { + "unsafeName": "PAYLOAD", + "safeName": "PAYLOAD" + }, + "pascalCase": { + "unsafeName": "Payload", + "safeName": "Payload" + } + } + }, + "typeReference": { + "value": { + "value": "type_:DeepItemResponseObjectPayload", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:ListResponseKind": { + "declaration": { + "name": { + "originalName": "ListResponseKind", + "camelCase": { + "unsafeName": "listResponseKind", + "safeName": "listResponseKind" + }, + "snakeCase": { + "unsafeName": "list_response_kind", + "safeName": "list_response_kind" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_RESPONSE_KIND", + "safeName": "LIST_RESPONSE_KIND" + }, + "pascalCase": { + "unsafeName": "ListResponseKind", + "safeName": "ListResponseKind" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "values": [ + { + "wireValue": "list", + "name": { + "originalName": "list", + "camelCase": { + "unsafeName": "list", + "safeName": "list" + }, + "snakeCase": { + "unsafeName": "list", + "safeName": "list" + }, + "screamingSnakeCase": { + "unsafeName": "LIST", + "safeName": "LIST" + }, + "pascalCase": { + "unsafeName": "List", + "safeName": "List" + } + } + } + ], + "type": "enum" + }, + "type_:ListResponse": { + "declaration": { + "name": { + "originalName": "ListResponse", + "camelCase": { + "unsafeName": "listResponse", + "safeName": "listResponse" + }, + "snakeCase": { + "unsafeName": "list_response", + "safeName": "list_response" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_RESPONSE", + "safeName": "LIST_RESPONSE" + }, + "pascalCase": { + "unsafeName": "ListResponse", + "safeName": "ListResponse" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "kind", + "name": { + "originalName": "kind", + "camelCase": { + "unsafeName": "kind", + "safeName": "kind" + }, + "snakeCase": { + "unsafeName": "kind", + "safeName": "kind" + }, + "screamingSnakeCase": { + "unsafeName": "KIND", + "safeName": "KIND" + }, + "pascalCase": { + "unsafeName": "Kind", + "safeName": "Kind" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ListResponseKind", + "type": "named" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "items", + "name": { + "originalName": "items", + "camelCase": { + "unsafeName": "items", + "safeName": "items" + }, + "snakeCase": { + "unsafeName": "items", + "safeName": "items" + }, + "screamingSnakeCase": { + "unsafeName": "ITEMS", + "safeName": "ITEMS" + }, + "pascalCase": { + "unsafeName": "Items", + "safeName": "Items" + } + } + }, + "typeReference": { + "value": { + "value": { + "value": "type_:ListResponseItem", + "type": "named" + }, + "type": "list" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:ListResponseItemMetaTag": { + "declaration": { + "name": { + "originalName": "ListResponseItemMetaTag", + "camelCase": { + "unsafeName": "listResponseItemMetaTag", + "safeName": "listResponseItemMetaTag" + }, + "snakeCase": { + "unsafeName": "list_response_item_meta_tag", + "safeName": "list_response_item_meta_tag" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_RESPONSE_ITEM_META_TAG", + "safeName": "LIST_RESPONSE_ITEM_META_TAG" + }, + "pascalCase": { + "unsafeName": "ListResponseItemMetaTag", + "safeName": "ListResponseItemMetaTag" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "values": [ + { + "wireValue": "alpha", + "name": { + "originalName": "alpha", + "camelCase": { + "unsafeName": "alpha", + "safeName": "alpha" + }, + "snakeCase": { + "unsafeName": "alpha", + "safeName": "alpha" + }, + "screamingSnakeCase": { + "unsafeName": "ALPHA", + "safeName": "ALPHA" + }, + "pascalCase": { + "unsafeName": "Alpha", + "safeName": "Alpha" + } + } + }, + { + "wireValue": "beta", + "name": { + "originalName": "beta", + "camelCase": { + "unsafeName": "beta", + "safeName": "beta" + }, + "snakeCase": { + "unsafeName": "beta", + "safeName": "beta" + }, + "screamingSnakeCase": { + "unsafeName": "BETA", + "safeName": "BETA" + }, + "pascalCase": { + "unsafeName": "Beta", + "safeName": "Beta" + } + } + } + ], + "type": "enum" + }, + "type_:ListResponseItemMeta": { + "declaration": { + "name": { + "originalName": "ListResponseItemMeta", + "camelCase": { + "unsafeName": "listResponseItemMeta", + "safeName": "listResponseItemMeta" + }, + "snakeCase": { + "unsafeName": "list_response_item_meta", + "safeName": "list_response_item_meta" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_RESPONSE_ITEM_META", + "safeName": "LIST_RESPONSE_ITEM_META" + }, + "pascalCase": { + "unsafeName": "ListResponseItemMeta", + "safeName": "ListResponseItemMeta" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "tag", + "name": { + "originalName": "tag", + "camelCase": { + "unsafeName": "tag", + "safeName": "tag" + }, + "snakeCase": { + "unsafeName": "tag", + "safeName": "tag" + }, + "screamingSnakeCase": { + "unsafeName": "TAG", + "safeName": "TAG" + }, + "pascalCase": { + "unsafeName": "Tag", + "safeName": "Tag" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ListResponseItemMetaTag", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + }, + "type_:ListResponseItem": { + "declaration": { + "name": { + "originalName": "ListResponseItem", + "camelCase": { + "unsafeName": "listResponseItem", + "safeName": "listResponseItem" + }, + "snakeCase": { + "unsafeName": "list_response_item", + "safeName": "list_response_item" + }, + "screamingSnakeCase": { + "unsafeName": "LIST_RESPONSE_ITEM", + "safeName": "LIST_RESPONSE_ITEM" + }, + "pascalCase": { + "unsafeName": "ListResponseItem", + "safeName": "ListResponseItem" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "properties": [ + { + "name": { + "wireValue": "id", + "name": { + "originalName": "id", + "camelCase": { + "unsafeName": "id", + "safeName": "id" + }, + "snakeCase": { + "unsafeName": "id", + "safeName": "id" + }, + "screamingSnakeCase": { + "unsafeName": "ID", + "safeName": "ID" + }, + "pascalCase": { + "unsafeName": "ID", + "safeName": "ID" + } + } + }, + "typeReference": { + "value": { + "value": "STRING", + "type": "primitive" + }, + "type": "optional" + } + }, + { + "name": { + "wireValue": "meta", + "name": { + "originalName": "meta", + "camelCase": { + "unsafeName": "meta", + "safeName": "meta" + }, + "snakeCase": { + "unsafeName": "meta", + "safeName": "meta" + }, + "screamingSnakeCase": { + "unsafeName": "META", + "safeName": "META" + }, + "pascalCase": { + "unsafeName": "Meta", + "safeName": "Meta" + } + } + }, + "typeReference": { + "value": { + "value": "type_:ListResponseItemMeta", + "type": "named" + }, + "type": "optional" + } + } + ], + "additionalProperties": false, + "type": "object" + } + }, + "headers": [], + "endpoints": { + "endpoint_.getItem": { + "declaration": { + "name": { + "originalName": "getItem", + "camelCase": { + "unsafeName": "getItem", + "safeName": "getItem" + }, + "snakeCase": { + "unsafeName": "get_item", + "safeName": "get_item" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ITEM", + "safeName": "GET_ITEM" + }, + "pascalCase": { + "unsafeName": "GetItem", + "safeName": "GetItem" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "location": { + "method": "GET", + "path": "/items" + }, + "request": { + "pathParameters": [], + "type": "body" + }, + "response": { + "type": "json" + }, + "examples": [] + }, + "endpoint_.getItemDeep": { + "declaration": { + "name": { + "originalName": "getItemDeep", + "camelCase": { + "unsafeName": "getItemDeep", + "safeName": "getItemDeep" + }, + "snakeCase": { + "unsafeName": "get_item_deep", + "safeName": "get_item_deep" + }, + "screamingSnakeCase": { + "unsafeName": "GET_ITEM_DEEP", + "safeName": "GET_ITEM_DEEP" + }, + "pascalCase": { + "unsafeName": "GetItemDeep", + "safeName": "GetItemDeep" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "location": { + "method": "GET", + "path": "/items/deep" + }, + "request": { + "pathParameters": [], + "type": "body" + }, + "response": { + "type": "json" + }, + "examples": [] + }, + "endpoint_.getList": { + "declaration": { + "name": { + "originalName": "getList", + "camelCase": { + "unsafeName": "getList", + "safeName": "getList" + }, + "snakeCase": { + "unsafeName": "get_list", + "safeName": "get_list" + }, + "screamingSnakeCase": { + "unsafeName": "GET_LIST", + "safeName": "GET_LIST" + }, + "pascalCase": { + "unsafeName": "GetList", + "safeName": "GetList" + } + }, + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "location": { + "method": "GET", + "path": "/lists" + }, + "request": { + "pathParameters": [], + "type": "body" + }, + "response": { + "type": "json" + }, + "examples": [] + } + }, + "pathParameters": [], + "environments": { + "defaultEnvironment": "Default", + "environments": { + "environments": [ + { + "id": "Default", + "name": { + "originalName": "Default", + "camelCase": { + "unsafeName": "default", + "safeName": "default" + }, + "snakeCase": { + "unsafeName": "default", + "safeName": "default" + }, + "screamingSnakeCase": { + "unsafeName": "DEFAULT", + "safeName": "DEFAULT" + }, + "pascalCase": { + "unsafeName": "Default", + "safeName": "Default" + } + }, + "url": "https://api.example.com" + } + ], + "type": "singleBaseUrl" + } + } + }, + "apiPlayground": true, + "casingsConfig": { + "smartCasing": true + }, + "subpackages": {}, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "service": "service_", + "types": [ + "type_:ItemResponse", + "type_:ItemResponseObjectType", + "type_:ItemResponseObjectData", + "type_:ItemResponseObject", + "type_:DeepItemResponse", + "type_:DeepItemResponseBody", + "type_:DeepItemResponseObjectKind", + "type_:DeepItemResponseObjectPayload", + "type_:DeepItemResponseObject", + "type_:ListResponseKind", + "type_:ListResponse", + "type_:ListResponseItemMetaTag", + "type_:ListResponseItemMeta", + "type_:ListResponseItem" + ], + "errors": [], + "subpackages": [], + "hasEndpointsInTree": true, + "hasWebSocketInTree": false + }, + "sdkConfig": { + "isAuthMandatory": false, + "hasStreamingEndpoints": false, + "hasPaginatedEndpoints": false, + "hasFileDownloadEndpoints": false, + "platformHeaders": { + "language": "X-Fern-Language", + "sdkName": "X-Fern-SDK-Name", + "sdkVersion": "X-Fern-SDK-Version" + } + } +} \ No newline at end of file diff --git a/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/v3-sdks/v3-nested-inline-objects-audiences.json b/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/v3-sdks/v3-nested-inline-objects-audiences.json new file mode 100644 index 000000000000..7483107f8f29 --- /dev/null +++ b/packages/cli/api-importers/v3-importer-tests/src/__test__/__snapshots__/v3-sdks/v3-nested-inline-objects-audiences.json @@ -0,0 +1,2694 @@ +{ + "auth": { + "requirement": "ALL", + "schemes": [] + }, + "selfHosted": false, + "types": { + "ItemResponse": { + "name": { + "typeId": "ItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponse" + }, + "shape": { + "properties": [ + { + "name": "object", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject", + "typeId": "ItemResponseObject", + "inline": false, + "displayName": "ItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObject_example_autogenerated": { + "type": "item", + "data": { + "id": "string", + "name": "string", + "price_cents": 1, + "internal_field": "string" + } + } + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponse_example_autogenerated": {} + } + } + }, + "ItemResponseObjectType": { + "name": { + "typeId": "ItemResponseObjectType", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectType" + }, + "shape": { + "values": [ + { + "name": "item" + } + ], + "type": "enum" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectType_example_autogenerated": "item" + } + } + }, + "ItemResponseObjectData": { + "name": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "shape": { + "properties": [ + { + "name": "id", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectDataId_example_autogenerated": "string" + } + } + }, + { + "name": "name", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "docs": "The name of the item.", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectDataName_example_autogenerated": "string" + } + } + }, + { + "name": "price_cents", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "INTEGER", + "v2": { + "validation": {}, + "type": "integer" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "docs": "The price in cents.", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectDataPriceCents_example_autogenerated": 1 + } + } + }, + { + "name": "internal_field", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "docs": "Internal-only field; scrubbed from the public audience.", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectDataInternalField_example_autogenerated": "string" + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectData_example_autogenerated": {} + } + } + }, + "ItemResponseObject": { + "name": { + "typeId": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject" + }, + "shape": { + "properties": [ + { + "name": "type", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectType", + "typeId": "ItemResponseObjectType", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectType_example_autogenerated": "item" + } + } + }, + { + "name": "data", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData", + "typeId": "ItemResponseObjectData", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObjectData_example_autogenerated": {} + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ItemResponseObject_example_autogenerated": {} + } + } + }, + "DeepItemResponse": { + "name": { + "typeId": "DeepItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponse" + }, + "shape": { + "properties": [ + { + "name": "body", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseBody", + "typeId": "DeepItemResponseBody", + "inline": false, + "displayName": "DeepItemResponseBody", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseBody_example_autogenerated": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "string", + "label": "string" + } + } + } + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponse_example_autogenerated": {} + } + } + }, + "DeepItemResponseBody": { + "name": { + "typeId": "DeepItemResponseBody", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseBody" + }, + "shape": { + "properties": [ + { + "name": "object", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject", + "typeId": "DeepItemResponseObject", + "inline": false, + "displayName": "DeepItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseBodyObject_example_autogenerated": { + "kind": "deep-item", + "payload": { + "uuid": "string", + "label": "string" + } + } + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseBody_example_autogenerated": {} + } + } + }, + "DeepItemResponseObjectKind": { + "name": { + "typeId": "DeepItemResponseObjectKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectKind" + }, + "shape": { + "values": [ + { + "name": "deep-item" + } + ], + "type": "enum" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectKind_example_autogenerated": "deep-item" + } + } + }, + "DeepItemResponseObjectPayload": { + "name": { + "typeId": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload" + }, + "shape": { + "properties": [ + { + "name": "uuid", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectPayloadUuid_example_autogenerated": "string" + } + } + }, + { + "name": "label", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectPayloadLabel_example_autogenerated": "string" + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectPayload_example_autogenerated": {} + } + } + }, + "DeepItemResponseObject": { + "name": { + "typeId": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject" + }, + "shape": { + "properties": [ + { + "name": "kind", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectKind", + "typeId": "DeepItemResponseObjectKind", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectKind_example_autogenerated": "deep-item" + } + } + }, + { + "name": "payload", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload", + "typeId": "DeepItemResponseObjectPayload", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObjectPayload_example_autogenerated": {} + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "DeepItemResponseObject_example_autogenerated": {} + } + } + }, + "ListResponseKind": { + "name": { + "typeId": "ListResponseKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseKind" + }, + "shape": { + "values": [ + { + "name": "list" + } + ], + "type": "enum" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseKind_example_autogenerated": "list" + } + } + }, + "ListResponse": { + "name": { + "typeId": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse" + }, + "shape": { + "properties": [ + { + "name": "kind", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseKind", + "typeId": "ListResponseKind", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseKind_example_autogenerated": "list" + } + } + }, + { + "name": "items", + "valueType": { + "container": { + "optional": { + "container": { + "list": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem", + "typeId": "ListResponseItem", + "inline": false, + "displayName": "ListResponseItem", + "type": "named" + }, + "type": "list" + }, + "type": "container" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItems_example_autogenerated": [ + {} + ] + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponse_example_autogenerated": {} + } + } + }, + "ListResponseItemMetaTag": { + "name": { + "typeId": "ListResponseItemMetaTag", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag" + }, + "shape": { + "values": [ + { + "name": "alpha" + }, + { + "name": "beta" + } + ], + "type": "enum" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItemMetaTag_example_autogenerated": "alpha" + } + } + }, + "ListResponseItemMeta": { + "name": { + "typeId": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta" + }, + "shape": { + "properties": [ + { + "name": "tag", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag", + "typeId": "ListResponseItemMetaTag", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItemMetaTag_example_autogenerated": "alpha" + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItemMeta_example_autogenerated": {} + } + } + }, + "ListResponseItem": { + "name": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "shape": { + "properties": [ + { + "name": "id", + "valueType": { + "container": { + "optional": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItemId_example_autogenerated": "string" + } + } + }, + { + "name": "meta", + "valueType": { + "container": { + "optional": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta", + "typeId": "ListResponseItemMeta", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + }, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItemMeta_example_autogenerated": {} + } + } + } + ], + "extends": [], + "extendedProperties": [], + "extraProperties": false, + "type": "object" + }, + "autogeneratedExamples": [], + "userProvidedExamples": [], + "referencedTypes": {}, + "inline": false, + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "ListResponseItem_example_autogenerated": {} + } + } + } + }, + "services": { + "service_": { + "name": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + } + }, + "basePath": { + "head": "", + "parts": [] + }, + "headers": [], + "pathParameters": [], + "endpoints": [ + { + "method": "GET", + "baseUrl": "https://api.example.com", + "path": { + "head": "/items", + "parts": [] + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "responseHeaders": [], + "errors": [], + "auth": false, + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "2df3cb27", + "url": "/items", + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [], + "response": { + "value": { + "value": { + "jsonExample": { + "object": { + "type": "item", + "data": { + "id": "id", + "name": "name", + "price_cents": 1, + "internal_field": "internal_field" + } + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "object", + "originalTypeDeclaration": { + "typeId": "ItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponse" + }, + "value": { + "jsonExample": { + "type": "item", + "data": { + "id": "id", + "name": "name", + "price_cents": 1, + "internal_field": "internal_field" + } + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "type": "item", + "data": { + "id": "id", + "name": "name", + "price_cents": 1, + "internal_field": "internal_field" + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "type", + "originalTypeDeclaration": { + "typeId": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject" + }, + "value": { + "jsonExample": "item", + "shape": { + "container": { + "optional": { + "jsonExample": "item", + "shape": { + "shape": { + "value": "item", + "type": "enum" + }, + "typeName": { + "typeId": "ItemResponseObjectType", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectType" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectType", + "typeId": "ItemResponseObjectType", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "data", + "originalTypeDeclaration": { + "typeId": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject" + }, + "value": { + "jsonExample": { + "id": "id", + "name": "name", + "price_cents": 1, + "internal_field": "internal_field" + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "id": "id", + "name": "name", + "price_cents": 1, + "internal_field": "internal_field" + }, + "shape": { + "shape": { + "properties": [ + { + "name": "id", + "originalTypeDeclaration": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "value": { + "jsonExample": "id", + "shape": { + "container": { + "optional": { + "jsonExample": "id", + "shape": { + "primitive": { + "string": { + "original": "id" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "name", + "originalTypeDeclaration": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "value": { + "jsonExample": "name", + "shape": { + "container": { + "optional": { + "jsonExample": "name", + "shape": { + "primitive": { + "string": { + "original": "name" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "price_cents", + "originalTypeDeclaration": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "value": { + "jsonExample": 1, + "shape": { + "container": { + "optional": { + "jsonExample": 1, + "shape": { + "primitive": { + "integer": 1, + "type": "integer" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "INTEGER", + "v2": { + "validation": {}, + "type": "integer" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "internal_field", + "originalTypeDeclaration": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "value": { + "jsonExample": "internal_field", + "shape": { + "container": { + "optional": { + "jsonExample": "internal_field", + "shape": { + "primitive": { + "string": { + "original": "internal_field" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ItemResponseObjectData", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObjectData", + "typeId": "ItemResponseObjectData", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponseObject", + "typeId": "ItemResponseObject", + "inline": false, + "displayName": "ItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponse" + }, + "type": "named" + } + }, + "type": "body" + }, + "type": "ok" + } + } + } + ], + "idempotent": false, + "fullPath": { + "head": "/items", + "parts": [] + }, + "allPathParameters": [], + "source": { + "type": "openapi" + }, + "audiences": [ + "public" + ], + "id": "endpoint_.getItem", + "name": "getItem", + "v2RequestBodies": {}, + "response": { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponse", + "typeId": "ItemResponse", + "inline": false, + "displayName": "ItemResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getItemExample": { + "object": { + "type": "item", + "data": { + "id": "string", + "name": "string", + "price_cents": 1, + "internal_field": "string" + } + } + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + }, + "v2Examples": { + "autogeneratedExamples": { + "base_getItemExample_200": { + "displayName": "getItemExample", + "request": { + "endpoint": { + "method": "GET", + "path": "/items" + }, + "environment": "https://api.example.com", + "pathParameters": {}, + "queryParameters": {}, + "headers": {} + }, + "response": { + "statusCode": 200, + "body": { + "value": { + "object": { + "type": "item", + "data": { + "id": "string", + "name": "string", + "price_cents": 1, + "internal_field": "string" + } + } + }, + "type": "json" + } + } + } + }, + "userSpecifiedExamples": {} + }, + "v2Responses": { + "responses": [ + { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ItemResponse", + "typeId": "ItemResponse", + "inline": false, + "displayName": "ItemResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getItemExample": { + "object": { + "type": "item", + "data": { + "id": "string", + "name": "string", + "price_cents": 1, + "internal_field": "string" + } + } + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + } + ] + } + }, + { + "method": "GET", + "baseUrl": "https://api.example.com", + "path": { + "head": "/items/deep", + "parts": [] + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "responseHeaders": [], + "errors": [], + "auth": false, + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "e438aa56", + "url": "/items/deep", + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [], + "response": { + "value": { + "value": { + "jsonExample": { + "body": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "uuid", + "label": "label" + } + } + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "body", + "originalTypeDeclaration": { + "typeId": "DeepItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponse" + }, + "value": { + "jsonExample": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "uuid", + "label": "label" + } + } + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "uuid", + "label": "label" + } + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "object", + "originalTypeDeclaration": { + "typeId": "DeepItemResponseBody", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseBody" + }, + "value": { + "jsonExample": { + "kind": "deep-item", + "payload": { + "uuid": "uuid", + "label": "label" + } + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "kind": "deep-item", + "payload": { + "uuid": "uuid", + "label": "label" + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "kind", + "originalTypeDeclaration": { + "typeId": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject" + }, + "value": { + "jsonExample": "deep-item", + "shape": { + "container": { + "optional": { + "jsonExample": "deep-item", + "shape": { + "shape": { + "value": "deep-item", + "type": "enum" + }, + "typeName": { + "typeId": "DeepItemResponseObjectKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectKind" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectKind", + "typeId": "DeepItemResponseObjectKind", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "payload", + "originalTypeDeclaration": { + "typeId": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject" + }, + "value": { + "jsonExample": { + "uuid": "uuid", + "label": "label" + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "uuid": "uuid", + "label": "label" + }, + "shape": { + "shape": { + "properties": [ + { + "name": "uuid", + "originalTypeDeclaration": { + "typeId": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload" + }, + "value": { + "jsonExample": "uuid", + "shape": { + "container": { + "optional": { + "jsonExample": "uuid", + "shape": { + "primitive": { + "string": { + "original": "uuid" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "label", + "originalTypeDeclaration": { + "typeId": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload" + }, + "value": { + "jsonExample": "label", + "shape": { + "container": { + "optional": { + "jsonExample": "label", + "shape": { + "primitive": { + "string": { + "original": "label" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": {}, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "DeepItemResponseObjectPayload", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObjectPayload", + "typeId": "DeepItemResponseObjectPayload", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "DeepItemResponseObject", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseObject", + "typeId": "DeepItemResponseObject", + "inline": false, + "displayName": "DeepItemResponseObject", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "DeepItemResponseBody", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseBody" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponseBody", + "typeId": "DeepItemResponseBody", + "inline": false, + "displayName": "DeepItemResponseBody", + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "DeepItemResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponse" + }, + "type": "named" + } + }, + "type": "body" + }, + "type": "ok" + } + } + } + ], + "idempotent": false, + "fullPath": { + "head": "/items/deep", + "parts": [] + }, + "allPathParameters": [], + "source": { + "type": "openapi" + }, + "audiences": [ + "public" + ], + "id": "endpoint_.getItemDeep", + "name": "getItemDeep", + "v2RequestBodies": {}, + "response": { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponse", + "typeId": "DeepItemResponse", + "inline": false, + "displayName": "DeepItemResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getItemDeepExample": { + "body": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "string", + "label": "string" + } + } + } + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + }, + "v2Examples": { + "autogeneratedExamples": { + "base_getItemDeepExample_200": { + "displayName": "getItemDeepExample", + "request": { + "endpoint": { + "method": "GET", + "path": "/items/deep" + }, + "environment": "https://api.example.com", + "pathParameters": {}, + "queryParameters": {}, + "headers": {} + }, + "response": { + "statusCode": 200, + "body": { + "value": { + "body": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "string", + "label": "string" + } + } + } + }, + "type": "json" + } + } + } + }, + "userSpecifiedExamples": {} + }, + "v2Responses": { + "responses": [ + { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "DeepItemResponse", + "typeId": "DeepItemResponse", + "inline": false, + "displayName": "DeepItemResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getItemDeepExample": { + "body": { + "object": { + "kind": "deep-item", + "payload": { + "uuid": "string", + "label": "string" + } + } + } + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + } + ] + } + }, + { + "method": "GET", + "baseUrl": "https://api.example.com", + "path": { + "head": "/lists", + "parts": [] + }, + "pathParameters": [], + "queryParameters": [], + "headers": [], + "responseHeaders": [], + "errors": [], + "auth": false, + "userSpecifiedExamples": [], + "autogeneratedExamples": [ + { + "example": { + "id": "36345ef3", + "url": "/lists", + "endpointHeaders": [], + "endpointPathParameters": [], + "queryParameters": [], + "servicePathParameters": [], + "serviceHeaders": [], + "rootPathParameters": [], + "response": { + "value": { + "value": { + "jsonExample": { + "kind": "list", + "items": [ + { + "id": "id", + "meta": { + "tag": "alpha" + } + }, + { + "id": "id", + "meta": { + "tag": "alpha" + } + } + ] + }, + "shape": { + "shape": { + "properties": [ + { + "name": "kind", + "originalTypeDeclaration": { + "typeId": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse" + }, + "value": { + "jsonExample": "list", + "shape": { + "container": { + "optional": { + "jsonExample": "list", + "shape": { + "shape": { + "value": "list", + "type": "enum" + }, + "typeName": { + "typeId": "ListResponseKind", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseKind" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseKind", + "typeId": "ListResponseKind", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "items", + "originalTypeDeclaration": { + "typeId": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse" + }, + "value": { + "jsonExample": [ + { + "id": "id", + "meta": { + "tag": "alpha" + } + }, + { + "id": "id", + "meta": { + "tag": "alpha" + } + } + ], + "shape": { + "container": { + "optional": { + "jsonExample": [ + { + "id": "id", + "meta": { + "tag": "alpha" + } + }, + { + "id": "id", + "meta": { + "tag": "alpha" + } + } + ], + "shape": { + "container": { + "list": [ + { + "jsonExample": { + "id": "id", + "meta": { + "tag": "alpha" + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "id", + "originalTypeDeclaration": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "value": { + "jsonExample": "id", + "shape": { + "container": { + "optional": { + "jsonExample": "id", + "shape": { + "primitive": { + "string": { + "original": "id" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "meta", + "originalTypeDeclaration": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "value": { + "jsonExample": { + "tag": "alpha" + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "tag": "alpha" + }, + "shape": { + "shape": { + "properties": [ + { + "name": "tag", + "originalTypeDeclaration": { + "typeId": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta" + }, + "value": { + "jsonExample": "alpha", + "shape": { + "container": { + "optional": { + "jsonExample": "alpha", + "shape": { + "shape": { + "value": "alpha", + "type": "enum" + }, + "typeName": { + "typeId": "ListResponseItemMetaTag", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag", + "typeId": "ListResponseItemMetaTag", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta", + "typeId": "ListResponseItemMeta", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "type": "named" + } + }, + { + "jsonExample": { + "id": "id", + "meta": { + "tag": "alpha" + } + }, + "shape": { + "shape": { + "properties": [ + { + "name": "id", + "originalTypeDeclaration": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "value": { + "jsonExample": "id", + "shape": { + "container": { + "optional": { + "jsonExample": "id", + "shape": { + "primitive": { + "string": { + "original": "id" + }, + "type": "string" + }, + "type": "primitive" + } + }, + "valueType": { + "primitive": { + "v1": "STRING", + "v2": { + "validation": { + "format": "uuid" + }, + "type": "string" + } + }, + "type": "primitive" + }, + "type": "optional" + }, + "type": "container" + } + } + }, + { + "name": "meta", + "originalTypeDeclaration": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "value": { + "jsonExample": { + "tag": "alpha" + }, + "shape": { + "container": { + "optional": { + "jsonExample": { + "tag": "alpha" + }, + "shape": { + "shape": { + "properties": [ + { + "name": "tag", + "originalTypeDeclaration": { + "typeId": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta" + }, + "value": { + "jsonExample": "alpha", + "shape": { + "container": { + "optional": { + "jsonExample": "alpha", + "shape": { + "shape": { + "value": "alpha", + "type": "enum" + }, + "typeName": { + "typeId": "ListResponseItemMetaTag", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMetaTag", + "typeId": "ListResponseItemMetaTag", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ListResponseItemMeta", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta" + }, + "type": "named" + } + }, + "valueType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItemMeta", + "typeId": "ListResponseItemMeta", + "inline": false, + "type": "named" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ListResponseItem", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem" + }, + "type": "named" + } + } + ], + "itemType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem", + "typeId": "ListResponseItem", + "inline": false, + "displayName": "ListResponseItem", + "type": "named" + }, + "type": "list" + }, + "type": "container" + } + }, + "valueType": { + "container": { + "list": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponseItem", + "typeId": "ListResponseItem", + "inline": false, + "displayName": "ListResponseItem", + "type": "named" + }, + "type": "list" + }, + "type": "container" + }, + "type": "optional" + }, + "type": "container" + } + } + } + ], + "type": "object" + }, + "typeName": { + "typeId": "ListResponse", + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse" + }, + "type": "named" + } + }, + "type": "body" + }, + "type": "ok" + } + } + } + ], + "idempotent": false, + "fullPath": { + "head": "/lists", + "parts": [] + }, + "allPathParameters": [], + "source": { + "type": "openapi" + }, + "audiences": [ + "public" + ], + "id": "endpoint_.getList", + "name": "getList", + "v2RequestBodies": {}, + "response": { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse", + "typeId": "ListResponse", + "inline": false, + "displayName": "ListResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getListExample": { + "kind": "list", + "items": [ + { + "id": "string", + "meta": { + "tag": "alpha" + } + } + ] + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + }, + "v2Examples": { + "autogeneratedExamples": { + "base_getListExample_200": { + "displayName": "getListExample", + "request": { + "endpoint": { + "method": "GET", + "path": "/lists" + }, + "environment": "https://api.example.com", + "pathParameters": {}, + "queryParameters": {}, + "headers": {} + }, + "response": { + "statusCode": 200, + "body": { + "value": { + "kind": "list", + "items": [ + { + "id": "string", + "meta": { + "tag": "alpha" + } + } + ] + }, + "type": "json" + } + } + } + }, + "userSpecifiedExamples": {} + }, + "v2Responses": { + "responses": [ + { + "statusCode": 200, + "body": { + "value": { + "responseBodyType": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "name": "ListResponse", + "typeId": "ListResponse", + "inline": false, + "displayName": "ListResponse", + "type": "named" + }, + "docs": "ok", + "v2Examples": { + "userSpecifiedExamples": {}, + "autogeneratedExamples": { + "getListExample": { + "kind": "list", + "items": [ + { + "id": "string", + "meta": { + "tag": "alpha" + } + } + ] + } + } + }, + "type": "response" + }, + "type": "json" + }, + "docs": "ok" + } + ] + } + } + ] + } + }, + "errors": {}, + "webhookGroups": {}, + "headers": [], + "idempotencyHeaders": [], + "apiDisplayName": "Nested object audience-filtering regression fixture", + "pathParameters": [], + "errorDiscriminationStrategy": { + "type": "statusCode" + }, + "variables": [], + "serviceTypeReferenceInfo": { + "sharedTypes": [], + "typesReferencedOnlyByService": {} + }, + "environments": { + "defaultEnvironment": "https://api.example.com", + "environments": { + "environments": [ + { + "id": "https://api.example.com", + "name": "https://api.example.com", + "url": "https://api.example.com" + } + ], + "type": "singleBaseUrl" + } + }, + "rootPackage": { + "fernFilepath": { + "allParts": [], + "packagePath": [] + }, + "service": "service_", + "types": [ + "ItemResponse", + "ItemResponseObject", + "DeepItemResponse", + "DeepItemResponseBody", + "DeepItemResponseObject", + "ListResponse", + "ListResponseItem" + ], + "errors": [], + "subpackages": [], + "hasEndpointsInTree": false + }, + "subpackages": {}, + "sdkConfig": { + "hasFileDownloadEndpoints": false, + "hasPaginatedEndpoints": false, + "hasStreamingEndpoints": false, + "isAuthMandatory": true, + "platformHeaders": { + "language": "", + "sdkName": "", + "sdkVersion": "" + } + }, + "apiName": "Nested object audience-filtering regression fixture", + "constants": { + "errorInstanceIdKey": "errorInstanceId" + } +} \ No newline at end of file diff --git a/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/fern/generators.yml b/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/fern/generators.yml new file mode 100644 index 000000000000..602118874c2a --- /dev/null +++ b/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/fern/generators.yml @@ -0,0 +1,3 @@ +api: + specs: + - openapi: ../openapi.yml diff --git a/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/openapi.yml b/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/openapi.yml new file mode 100644 index 000000000000..f0ccd587ff39 --- /dev/null +++ b/packages/cli/api-importers/v3-importer-tests/src/__test__/fixtures/v3-nested-inline-objects-audiences/openapi.yml @@ -0,0 +1,129 @@ +openapi: 3.0.3 +info: + title: Nested object audience-filtering regression fixture + version: 1.0.0 + description: | + Regression coverage for the bug where, when `x-fern-audiences` filtering is + active, transitively-referenced named types resolve to `any` in the docs + site because `IrGraph.addReferencedTypes` only walked one level of + descendants. Each schema below exercises a slightly different shape of the + dependency chain so we catch deeper regressions. +servers: + - url: https://api.example.com +paths: + # Customer-reported shape: outer schema has a property whose type is a sibling + # component, and that sibling has its own inline-object properties. Before the + # fix, the inline child types under the sibling were dropped during audience + # filtering and the docs site rendered them as `any`. + /items: + get: + operationId: getItem + x-fern-audiences: ["public"] + responses: + "200": + description: ok + content: + application/json: + schema: + $ref: "#/components/schemas/ItemResponse" + # Deeper chain: ItemResponse → ItemResponseBody → ItemResponseObject → inline + # children. A single-level walk would only reach ItemResponseBody. + /items/deep: + get: + operationId: getItemDeep + x-fern-audiences: ["public"] + responses: + "200": + description: ok + content: + application/json: + schema: + $ref: "#/components/schemas/DeepItemResponse" + # List of $ref'd objects: exercises the container (list/array) path on the + # transitive walk. + /lists: + get: + operationId: getList + x-fern-audiences: ["public"] + responses: + "200": + description: ok + content: + application/json: + schema: + $ref: "#/components/schemas/ListResponse" +components: + schemas: + ItemResponse: + type: object + properties: + object: + $ref: "#/components/schemas/ItemResponseObject" + ItemResponseObject: + type: object + properties: + type: + type: string + enum: ["item"] + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + description: The name of the item. + price_cents: + type: integer + description: The price in cents. + internal_field: + type: string + description: Internal-only field; scrubbed from the public audience. + x-fern-audiences: ["internal"] + DeepItemResponse: + type: object + properties: + body: + $ref: "#/components/schemas/DeepItemResponseBody" + DeepItemResponseBody: + type: object + properties: + object: + $ref: "#/components/schemas/DeepItemResponseObject" + DeepItemResponseObject: + type: object + properties: + kind: + type: string + enum: ["deep-item"] + payload: + type: object + properties: + uuid: + type: string + format: uuid + label: + type: string + ListResponse: + type: object + properties: + kind: + type: string + enum: ["list"] + items: + type: array + items: + $ref: "#/components/schemas/ListResponseItem" + ListResponseItem: + type: object + properties: + id: + type: string + format: uuid + meta: + type: object + properties: + tag: + type: string + enum: ["alpha", "beta"] diff --git a/packages/cli/api-importers/v3-importer-tests/src/__test__/v3-nested-inline-objects-audiences.test.ts b/packages/cli/api-importers/v3-importer-tests/src/__test__/v3-nested-inline-objects-audiences.test.ts new file mode 100644 index 000000000000..ea239ef7186e --- /dev/null +++ b/packages/cli/api-importers/v3-importer-tests/src/__test__/v3-nested-inline-objects-audiences.test.ts @@ -0,0 +1,92 @@ +import type { Audiences } from "@fern-api/configuration"; +import { APIV1Db, convertAPIDefinitionToDb, convertDbAPIDefinitionToRead, SDKSnippetHolder } from "@fern-api/fdr-sdk"; +import { AbsoluteFilePath, join, RelativeFilePath } from "@fern-api/fs-utils"; +import { OSSWorkspace } from "@fern-api/lazy-fern-workspace"; +import { convertIrToFdrApi } from "@fern-api/register"; +import { createMockTaskContext } from "@fern-api/task-context"; +import { loadAPIWorkspace } from "@fern-api/workspace-loader"; +import { describe, expect, it } from "vitest"; + +const FIXTURES_DIR = join(AbsoluteFilePath.of(__dirname), RelativeFilePath.of("fixtures")); +const FIXTURE_NAME = "v3-nested-inline-objects-audiences"; + +async function getIR(audiences: Audiences) { + const fixturePath = join(FIXTURES_DIR, RelativeFilePath.of(FIXTURE_NAME), RelativeFilePath.of("fern")); + const context = createMockTaskContext(); + const workspace = await loadAPIWorkspace({ + absolutePathToWorkspace: fixturePath, + context, + cliVersion: "0.0.0", + workspaceName: FIXTURE_NAME + }); + if (!workspace.didSucceed) { + throw new Error(`Failed to load OpenAPI fixture ${FIXTURE_NAME}\n${JSON.stringify(workspace.failures)}`); + } + if (!(workspace.workspace instanceof OSSWorkspace)) { + throw new Error(`Expected OSSWorkspace for fixture ${FIXTURE_NAME}`); + } + // Mirror the `fern docs dev` / `fern check` path that the customer's report + // originates from, including enableUniqueErrorsPerEndpoint=true. + return workspace.workspace.getIntermediateRepresentation({ + context, + audiences, + enableUniqueErrorsPerEndpoint: true, + generateV1Examples: false, + logWarnings: false + }); +} + +function asFdrTypes(ir: Awaited>): Record { + const snippetHolder = new SDKSnippetHolder({ + snippetsBySdkId: {}, + snippetsConfigWithSdkId: {}, + snippetTemplatesByEndpoint: {}, + snippetsBySdkIdAndEndpointId: {}, + snippetTemplatesByEndpointId: {} + }); + const context = createMockTaskContext(); + const fdrApi = convertIrToFdrApi({ + ir, + snippetsConfig: { + typescriptSdk: undefined, + pythonSdk: undefined, + javaSdk: undefined, + rubySdk: undefined, + goSdk: undefined, + csharpSdk: undefined, + phpSdk: undefined, + swiftSdk: undefined, + rustSdk: undefined + }, + context + }); + const dbDef = convertAPIDefinitionToDb(fdrApi, APIV1Db.ApiDefinitionId("test-api"), snippetHolder); + const readDef = convertDbAPIDefinitionToRead(dbDef); + return readDef.types as Record; +} + +describe("nested inline objects survive audience filtering (regression)", () => { + // The bug: when an outer schema reaches its descendants via a chain of + // `$ref`s, only one level of descendants would be added during audience + // filtering, leaving deeper named types unresolved and rendered as `any` + // in the docs site. + it("preserves transitively-referenced named types across audience filter", async () => { + const filteredTypes = asFdrTypes(await getIR({ type: "select", audiences: ["public"] })); + const unfilteredTypes = asFdrTypes(await getIR({ type: "all" })); + + const unfilteredKeys = Object.keys(unfilteredTypes).sort(); + const filteredKeys = Object.keys(filteredTypes).sort(); + + // Every non-internal named type must survive the audience filter; the + // bug previously dropped deeply nested $ref targets such as + // `ItemResponseObject` and its synthetic `ItemResponseObjectData` + // children, leaving them rendered as `any` in the docs. + const expectedSurvivors = unfilteredKeys.filter((key) => !key.toLowerCase().includes("internal")); + expect( + filteredKeys, + `expected all non-internal types to survive audience filter; got=${JSON.stringify( + filteredKeys + )}, expected=${JSON.stringify(expectedSurvivors)}` + ).toEqual(expectedSurvivors); + }, 120_000); +}); diff --git a/packages/cli/cli/changes/unreleased/fix-audience-filtering-transitive-types.yml b/packages/cli/cli/changes/unreleased/fix-audience-filtering-transitive-types.yml new file mode 100644 index 000000000000..2979515f87f0 --- /dev/null +++ b/packages/cli/cli/changes/unreleased/fix-audience-filtering-transitive-types.yml @@ -0,0 +1,6 @@ +- summary: | + Fix x-fern-audiences filtering dropping transitively-referenced named types when an outer + schema reaches its descendants through a chain of $refs. Audience filtering now walks the + full type-dependency closure instead of a single level, so deeply nested object types are + preserved in the docs IR and no longer render as `any` in the docs site. + type: fix diff --git a/packages/commons/ir-utils/src/filtered-ir/IrGraph.ts b/packages/commons/ir-utils/src/filtered-ir/IrGraph.ts index b975773b09a4..81fc2024c7b4 100644 --- a/packages/commons/ir-utils/src/filtered-ir/IrGraph.ts +++ b/packages/commons/ir-utils/src/filtered-ir/IrGraph.ts @@ -576,32 +576,45 @@ export class IrGraph { return this.schemaIdToGraphTypeId.get(id) ?? id; } + /** + * BFS the type-dependency graph and add every transitively-reachable type + * to `types`. The walk must be recursive: an outer type's `allDescendants` + * may only list its direct dependencies (e.g. when a property uses `$ref` + * to another component schema, the outer type's referencedTypes contains + * the ref target but not the target's own inline-object descendants), so a + * single-level pass would silently drop deeper named types and they would + * later render as `any` in the docs. + */ private addReferencedTypes(types: Set, typesToAdd: Set): void { - for (const typeId of typesToAdd) { - if (types.has(typeId)) { + const queue: TypeId[] = [...typesToAdd]; + + while (queue.length > 0) { + const typeId = queue.pop(); + if (typeId == null || types.has(typeId)) { continue; } types.add(typeId); const typeNode = this.getTypeNode(typeId); + const enqueueDescendant = (descendantTypeId: TypeId): void => { + const resolved = this.resolveTypeId(descendantTypeId); + if (!types.has(resolved)) { + queue.push(resolved); + } + }; + if (this.audiences.type === "filtered") { for (const audienceId of this.audiences.audiences) { const descendantsForAudience = typeNode.descendantsByAudience[audienceId]; if (descendantsForAudience != null) { - descendantsForAudience.forEach((descendantTypeId) => { - types.add(this.resolveTypeId(descendantTypeId)); - }); + descendantsForAudience.forEach(enqueueDescendant); } else { - typeNode.allDescendants.forEach((descendantTypeId) => { - types.add(this.resolveTypeId(descendantTypeId)); - }); + typeNode.allDescendants.forEach(enqueueDescendant); break; } } } else { - typeNode.allDescendants.forEach((descendantTypeId) => { - types.add(this.resolveTypeId(descendantTypeId)); - }); + typeNode.allDescendants.forEach(enqueueDescendant); } } }