Generator diagnostics and errors
Classes
- Error: An error leads to undesired or unexpected behavior if not resolved. You should resolve all errors prior to moving into a 0.0.1 release.
- Warning: A warning indicates potential issues that could likely lead to unexpected behavior if not remediated. You should resolve all warnings prior to moving into a 1.0.0 release.
- Note: A note describes a potential for misunderstanding between the current configuration and what the you intend to do. May cause a breaking change if fixed in the future, so it should be investigated before a 1.0.0 release.
Types
ClientOpt
ClientOpt/NotFound
Example: Could not find client opt: {clientOptName}ClientOpt/NotValid
Example: Invalid client opt atclient_settings.opts.{clientOptName}
: {reason}ClientOpt/ShouldBeNullable
Example: Client opt atclient_settings.opts.{clientOptName}
should be nullable.
Config
Config/NotValid
Example: Your Stainless config is invalid: {reason}
Endpoint
Endpoint/IsIgnored
Example:{endpoint}
is present under the config keyunspecified_endpoints
and code will not be generated for it.Endpoint/NotConfigured
Example:{endpoint}
is present in the OpenAPI specification but isn't specified in Stainless config file.Endpoint/NotFound
Example: Could not find{endpoint}
in the OpenAPI spec.Endpoint/NotUnmapped
Example:{endpoint}
is inunspecified_endpoints
, but is also specified in theresources
section of the Stainless configEndpoint/NotValid
Example:{endpoint}
is not a valid endpoint.
Go
Go/DuplicateVariantDeserializationConditions
Example: The same deserialization condition deserializes to separate types:Go/DuplicateVariantNameForUnion
Example: Variant names for union{typeName}
at{oasRef}
overlap, as we could not infer good unique names for the variants.Go/MultipleFormatsInUnion
Example: multiple different schema formats found for variants of {oas_path}:Go/NameNotAllowed
Example: {reason}Go/SchemaUnionRequiresDiscriminator
Example: Adiscriminator
field should be present on this union for Go, which helps deserialization.Go/SchemaVariantRequiresDiscriminator
Example: Variant for union requires a property for discriminator{discriminatorPropertyName}
Go/SchemaVariantTypeNotSupported
Example: Variant type '{variantType}' is not currently supportedGo/SnippetNotValid
Example: Go example snippet did not format correctly
Method
Method/BodyRootParamNeedsName
Example: Encountered method with a non-object request body, defaulting to the name{fallbackName}
for the generated method argument.Method/ExpectedMatchPaginationScheme
Example: Expected method to have matched pagination scheme {paginationScheme} because it was explicitly configured in the method config.Method/ExpectedNoPagination
Example: Expected method to have not matched a pagination scheme because {reason}.Method/ExpectedPagination
Example: Expected{stainlessPath}
to have matched a pagination scheme because {reason}.Method/MatchedMultiplePages
Example: Found multiple matching pagination schemes, . Add an explicitpagination: {page_name}
to the method definition to disambiguate.Method/NameNotValid
Example: Method name invalid, please rename it: {reason}Method/NeedsRename
Example: Consider renaming method{method.name}
:{message}
Method/NotCustom
Example:{stainlessPath}
is not a custom method.Method/NotFound
Example: Could not find{stainlessPath}
.Method/PathComponentMissingParameter
Example: This endpoint is missing a parameter for path component{component}
.Method/PathHasRepeatedComponent
Example: This endpoint has duplicate path component{component}
in the path{endpoint}
, which may not be intended.Method/RequestBodyHasAdditionalProperties
Example: Request params schema definesadditionalProperties
but it will be ignoredMethod/RequestBodyNotSupported
Example: The endpoint is a GET method but has a request body. This is not recommended and will crash for JSfetch
users.Method/SuccessResponseNotFound
Example: Could not find a response with a supported2xx
status code andContent-Type
.
Model
Model/DuplicateDefinition
Example: Schema{refName}
is already declared as a model at{existingModelName}
; One of the model definitions should be removed.Model/DuplicateName
Example: Another model with name{existingModelName}
already exists. Models should always have a unique name, or a unique namespaced name under a resource declared as astandalone_api
.Model/IsIndirect
Example:{configRef}
points to a schema with an indirect$ref: {schemaRef}
, maybe it should point to that instead?Model/NeedsRename
Example: Consider renaming model{model.rawName}
; e.g.{suggestion}
'Model/NotFound
Example: Could not find{stainlessPath}
.Model/Recommended
Example: Schema at{oasRef}
should potentially be declared as a model within{resourceRecommendation}
.
OAS
OAS/InvalidExample
Example: Example is not valid for schemaOAS/InvalidUnionExample
Example: Could not find matching variant for the given example{}
OAS/ReferenceNotFound
Example: Reference pointed to by {refLocation} is missing from spec: {missingPointer}
Pagination
Pagination/DuplicatePurpose
Example: Pagination purpose '{purpose}' should only be defined once but it was defined {amount} times.Pagination/ExpectedItemsToBeObject
Example: Expected paginated items schema to be an 'object' type.Pagination/MissingProperty
Example: Could not infer a response property with a '{purpose}' purpose.Pagination/UnsupportedItemsSchemaType
Example: The paginated items schema must be an 'array' type, received '{schema.type}'.Pagination/UnsupportedPurposePlacement
Example: Explicit pagination purpose '{purpose}' can only be set for schemas within object properties but it was set on a schema with a {schema.parent.type} parent.Pagination/UnusedPurposeConfig
Example: Explicit pagination purpose config is defined but it was not used. Is '{schema.rawSchema.x-stainless-pagination-property.purpose}' a supported purpose for the '{page.type}' pagination type?
Parameter
Parameter/DuplicateName
Example: Found parameter with duplicate parameter name{param.name}
in{param.location}
.Parameter/HeaderIsNullable
Example: A header parameter oftype: null
or withnullable: true
is not supported and will be ignoredParameter/MissingSchema
Example: No schema for parameter is defined, assuming it's a schema oftype: string
Parameter/NameHasBrackets
Example: Parameter has supplied name{parameterName}
, the trailing[]
was stripped for the SDK parameter name.Parameter/NotConsistentWithPath
Example: OpenAPI inconsistency: implies a different set of parameters than the parameters object: {} vs {}Parameter/NotFound
Example: Got an unknown param in positional_params:{stainlessPath}
Parameter/NotValid
Example: {reason}Parameter/PathIsNullable
Example: A path parameter oftype: null
or withnullable: true
is not supported and will be ignoredParameter/SchemaTypeNotValid
Example: Schema type{type}
is not a valid path param type; Expected one of {supportedTypes.0}
Python
Python/DuplicateDeclaration
Example: We generated two separated types under the same name:{typename}
. If they are the referring to the same type, they should be extracted to the same ref and be declared as a model. Otherwise, they should be renamed withx-stainless-naming
Python/NameNotAllowed
Example: {reason}Python/PackageNameNotAllowed
Example: Package name {packageName} is not allowed.Python/PyPiPackageNameDeprecated
Example:targets.python.publish.pypi.package_name
is deprecated, please remove it in favour oftargets.python.project_name
Python/RequestParamShadowsDefault
Example: Request param '{name}' would shadow a request option with the same name
Readme
Readme/MissingPaginationSnippet
Example: Pagination has been configured but there is noreadme.example_requests.pagination
snippet definedReadme/MissingStreamingSnippet
Example: Streaming has been configured but there is noreadme.example_requests.streaming
snippet defined
ReadmeExample
ReadmeExample/CustomConfigNotValid
Example: {reason}ReadmeExample/MethodNotPaginated
Example: Expected method{method.name}
to be paginatedReadmeExample/MethodNotStreaming
Example: Expected method{method.name}
to be streamedReadmeExample/MissingNestedParam
Example: Expected the given example params to include a nested object; The '{suggestion.method.endpoint}' endpoint has a nested parameter, '{suggestion.param.key}'.ReadmeExample/MissingParam
Example: {reason}ReadmeExample/UnknownProperty
Example: {reason}
Reference
Reference/NotASchema
Example: Model path for{stainlessPath}
resolved to a value that doesn't look like a schema object, {}Reference/NotFound
Example: Cannot find schema{ref}
in OpenAPI spec.
Resource
Resource/HasConflict
Example:{paths.0}
has a name that conflicts with one or more resources.Resource/NotFound
Example: Could not find{stainlessPath}
.
Response
Response/SchemaTypeNotValidForText
Example: Expected schema withtype: 'string'
for content type {contentType}Response/TypeNotObjectForEnvelope
Example:unwrap_response_fields
has been set but the method's response type is{responseType}
notobject
.Response/UnsupportedContentType
Example: Did not find a supported operation response content type; Received {contentTypes.0}Response/UnsupportedHeaderType
Example: Unexpected non-primitive type:{type}
for response header schema:{name}
Ruby
Ruby/DefaultBodyParamsUnsupported
Example: The beta Ruby SDK generator does not yet supportdefault_body_params
Ruby/MultipleNamedModelsInIntersection
Example: Multiple named models found in intersection, currently only 1 named model is supported:Ruby/NameNotAllowed
Example: {reason}Ruby/PaginationTypeUnsupported
Example: The beta Ruby SDK generator does not yet support{type}
paginationRuby/SnippetNotFormatted
Example: Ruby snippet did not format correctly and may have a syntax error.Ruby/UnexpectedParams
Example: Unable to generate a method corresponding to the params in this methodRuby/UnimplementedType
Example: The beta Ruby SDK generator is not yet able to emit code for type{schema.type}
; values will be passed through as-is and documented asObject
for nowRuby/UnnamedType
Example: The beta Ruby SDK generator is not yet able to pick a meaningful name for this type, will use{generatedName}
for now
Schema
Schema/ArrayMissingItems
Example: {reason}Schema/CannotInferEnumMemberName
Example: Could not generate name for enum member{memberName}
in language {language}Schema/CannotInferName
Example: Sorry, the {language} codegen currently doesn't support inferring the name for this specific schema.Schema/CannotInferUnionVariantName
Example: Could not infer a name for the union variant.Schema/DiscriminatedUnionVariantMissingProperty
Example: Union variant doesn't define the property discriminator{propertyName}
which is required as the union schema definesdiscriminator.propertyName
Schema/EnumDescriptionNotValid
Example: {reason}Schema/EnumDuplicateMembers
Example: Enum has duplicate members:Schema/EnumIsAmbiguous
Example: Schema defines anenum
property that only includesnull
.Schema/EnumMemberTypeNotValid
Example: Enum member has type{}
which is not a primitive type.Schema/ExternalReference
Example: Schema $ref {} could not be resolved, is it an external reference? e.g. file or urlSchema/InconsistentEnumMembers
Example: Inconsistent enum member type encountered, expected {expectedType} but received objectSchema/IsAmbiguous
Example: Ambiguous schema object does not have at least one of: type, oneOf, anyOf, or allOf. The most common solution is to edit the OpenAPI spec and add a missingtype
. If you meant for the schema to accept anything, addx-stainless-any
to suppress this message. Or you may want to use the replaceMatchingSchemas transform. Ambiguous schema object has been interpreted as: unknownSchema/MixedDefinitions
Example: Schema defines{key}
but also a non-emptyproperties
. The schema should probably not haveproperties
.Schema/MultipleEnumMemberTypes
Example: Found enum members with different types (). To fix, this should likely be ananyOf
instead.Schema/ObjectHasNoProperties
Example: Schema does not define aproperties
or anadditionalProperties
key and is interpreted asunknown
.Schema/RecursiveMustBeModel
Example: Schema$ref: '{recursiveRefName}'
is recursively referenced and should be added as a model to the Stainless config.Schema/RequiredPropertyNotDefined
Example: Found properties inrequired
that aren't defined as properties ().Schema/StringFormatNotSupported
Example: Unknown schema formatformat: {format}
Schema/TypeMissing
Example: Schema is missing atype
property, and it was not automatically inferred.Schema/TypeNotValid
Example: Schema type{type}
is not a part of the JSON Schema specification and not supported by Stainless.Schema/UnstableName
Example: Name generation falling back to using the $ref name, this can result in breaking changes in the future
Security
Security/MissingConfiguration
Example: No valid root-level 'security' section in your Stainless config or OpenAPI specification files, so authentication is not configured for your SDKs. See https://app.stainlessapi.com/docs/guides/configure#authentication for details.Security/SchemeNotFound
Example: Could not find security scheme: {securitySchemeName}Security/SchemeNotSupported
Example: Security scheme not yet supported: {securitySchemeName}. Please contact support@stainlessapi.com with your use-case, and we can likely add this.Security/SchemeNotValid
Example: Invalid security scheme '{securitySchemeName}': {reason}
Streaming
Streaming/CannotInferParamsName
Example: No model name,$ref
orstreaming.param_type_name
defined - using default params type nameStreaming/UnsupportedParamsStructure
Example: Streaming method uses a union type for request params which is not supported yet.
Terraform
Terraform/DataSourceAttributeTypeMismatch
Example: ({resource.name}) resource has multiple methods with conflicting types for attribute {}, which is omitted as a data source parameter.Terraform/PotentiallyConfusingPaginationAttribute
Example: ({resource.name}) resource has a property with the name {} which could be a pagination attribute that should be abstracted away in Terraform.Terraform/ResourceCannotBeInferred
Example: ({resourceName}) {detail}Terraform/ResourceHasAmbiguousProperties
Example: ({resourceName}) resource has some properties with an undefined type, which results in a raw JSON field. To resolve, add type annotations to the following properties:Terraform/ResourceHasNamingCollision
Example: ({resource.name}) resource has a property with the name {} which conflicts with the name of the {} {attributeType} attribute. As an interim measure, To resolve, please {customerAction}.Terraform/UnknownInUnion
Example: One of the variants in a union has an undefined type, so it was omitted. Add type annotations to the variant have it included, or use x-stainless-skip to omit the variant explicitly.Terraform/UnsupportedDeleteBehaviorUnspecified
Example: ({resourceName}) Could not find a delete operation. If the resource does not support deletion, provide a value for 'unsupported_delete_behavior'.Terraform/UnsupportedQueryType
Example: ({resource.name}) resource has a property {} of type {} which is currently unsupported in Terraform.
Transform
Transform/Failed
Example: Transformation {command} at step {step} exited with a failureTransform/InvalidTransform
Example: {message}
Unsupported
Unsupported/WebhookUnwrap
Example: Webhook unwrap method tests are not currently supported for {language}
Misc
BootstrapCommandError
Example: A bootstrap command reported an error: {command}CustomSnippetNotFound
Example: Cannot find custom snippet '{snippetName}' for language '{language}'CustomSnippetNotFoundInLanguage
Example: Expected '{snippetName}' snippet to have a {language} definition but it could not be foundFatalError
Example: Fatal error while generating codeFormatterCommandError
Example: A formatter reported an error: {command}InvalidInternalState
Example: {message}LinterCommandError
Example: A linter reported issues: {command}TestCommandError
Example: A test command reported an error: {command}JavaUnsupportedAliasModel
Example: We currently do not support generating alias models in Java/Kotlin. You will have to remove it from the config.