Skip to content

[V] createDiagnostic

createDiagnostic: <C, M>(diag) => Diagnostic;

Creates a library-qualified diagnostic without reporting it; the caller owns reporting or returning it.

Type Parameter
C extends | "union-model-discriminator-conflict" | "union-model-conversion-conflict" | "union-null" | "union-circular" | "invalid-access" | "invalid-usage" | "lro-status-metadata-structural-property" | "lro-operation-id-invalid-target" | "lro-operation-id-duplicate" | "lro-operation-id-missing-link" | "conflicting-multipart-model-usage" | "wrong-client-decorator" | "unsupported-kind" | "server-param-not-path" | "multiple-response-types" | "no-corresponding-method-param" | "unsupported-protocol" | "no-emitter-name" | "unsupported-generic-decorator-arg-type" | "empty-client-name" | "override-parameters-mismatch" | "override-response-replacement" | "duplicate-client-name" | "duplicate-client-name-warning" | "client-name-ineffective" | "example-loading" | "duplicate-example-file" | "example-value-no-mapping" | "flatten-polymorphism" | "conflict-access-override" | "empty-client-namespace" | "invalid-alternate-type" | "invalid-initialized-by" | "invalid-deserializeEmptyStringAsNull-target-type" | "invalid-encode-for-collection-format" | "non-head-bool-response-decorator" | "require-versioned-service" | "missing-service-versions" | "invalid-client-doc-mode" | "multiple-param-alias" | "client-location-conflict" | "client-location-wrong-type" | "legacy-hierarchy-building-conflict" | "legacy-hierarchy-building-circular-reference" | "missing-scope" | "required-parameter-scoped-out" | "external-library-version-mismatch" | "external-type-on-model-property" | "invalid-mark-as-lro-target" | "mark-as-lro-ineffective" | "invalid-mark-as-pageable-target" | "mark-as-pageable-ineffective" | "api-version-undefined" | "root-client-missing-service" | "invalid-client-service-multiple" | "inconsistent-multiple-service-dependency" | "client-option" | "decorator-requires-scope" | "conflicting-scope" | "unnecessary-emitter-option" | "replace-parameter-not-found" | "reorder-parameter-not-found" | "reorder-parameter-missing" | "add-parameter-duplicate" | "reorder-parameter-duplicate" | "remove-parameter-not-found" | "nested-client-service-not-subset" | "auto-merge-service-conflict" | "client-default-value-type-mismatch"
M extends string | number | symbol
ParameterType
diagDiagnosticReport<{ "add-parameter-duplicate": { default: CallableMessage<["paramName", "operationName"]>; }; "api-version-undefined": { default: CallableMessage<["version"]>; }; "auto-merge-service-conflict": { default: "Auto-merging service client must be empty."; }; "client-default-value-type-mismatch": { default: CallableMessage<["valueType", "propertyType"]>; }; "client-location-conflict": { default: "@clientLocation with string target could not be used for multiple root clients scenario"; modelPropertyToClientInitialization: CallableMessage<["parameterName"]>; modelPropertyToString: "`@clientLocation` can only move model properties to interfaces or namespaces."; operationToOperation: "`@clientLocation` cannot be used to move an operation to another operation. Operations can only be moved to interfaces or namespaces."; parameterTypeConflict: CallableMessage<["parameterName"]>; }; "client-location-wrong-type": { default: "`@clientLocation` could only move operation to the interface or namespace belong to the root namespace with `@service`."; }; "client-name-ineffective": { default: CallableMessage<["name", "originalMethodName"]>; }; "client-option": { default: "@clientOption is experimental and should only be used for temporary workarounds. This usage must be suppressed."; }; "conflict-access-override": { default: "@access override conflicts with the access calculated from operation or other @access override."; }; "conflicting-multipart-model-usage": { default: CallableMessage<["modelName", "modelName", "modelName"]>; }; "conflicting-scope": { default: CallableMessage<["decoratorName", "optionsScope", "legacyScope"]>; }; "decorator-requires-scope": { default: CallableMessage<["decoratorName", "allowedScopes"]>; }; "duplicate-client-name": { default: CallableMessage<["name", "scope"]>; nonDecorator: CallableMessage<["name", "scope"]>; }; "duplicate-client-name-warning": { default: CallableMessage<["name", "scope"]>; nonDecorator: CallableMessage<["name", "scope"]>; }; "duplicate-example-file": { default: CallableMessage<["filename", "title", "operationId"]>; }; "empty-client-name": { default: "Cannot pass an empty value to the @clientName decorator"; }; "empty-client-namespace": { default: "Cannot pass an empty value to the @clientNamespace decorator"; }; "example-loading": { default: CallableMessage<["filename", "error"]>; noDirectory: CallableMessage<["directory"]>; noOperationId: CallableMessage<["filename"]>; }; "example-value-no-mapping": { default: CallableMessage<["relativePath", "value"]>; }; "external-library-version-mismatch": { default: CallableMessage<["libraryName", "versionA", "versionB"]>; }; "external-type-on-model-property": { default: "@alternateType with external type information cannot be applied to model properties. Please apply it to the type definition itself (Scalar, Model, Enum, or Union) instead."; }; "flatten-polymorphism": { default: "Cannot flatten property of polymorphic type."; }; "inconsistent-multiple-service-dependency": { default: CallableMessage<["clientName", "dependencyName", "versions"]>; }; "invalid-access": { default: “Access value must be \“public\” or \“internal\”.”; }; "invalid-alternate-type": { default: CallableMessage<["kindName"]>; }; "invalid-client-doc-mode": { default: CallableMessage<["mode"]>; }; "invalid-client-service-multiple": { default: "`@client` with multiple services is only allowed on `Namespace`."; }; "invalid-deserializeEmptyStringAsNull-target-type": { default: "@deserializeEmptyStringAsNull can only be applied to `ModelProperty` of type 'string' or a `Scalar` derived from 'string'."; }; "invalid-encode-for-collection-format": { default: "Only encode of `ArrayEncoding.pipeDelimited` and `ArrayEncoding.spaceDelimited` is supported for collection format."; }; "invalid-initialized-by": { default: CallableMessage<["message"]>; }; "invalid-mark-as-lro-target": { default: CallableMessage<[]>; }; "invalid-mark-as-pageable-target": { default: CallableMessage<[]>; }; "invalid-usage": { default: "Usage value must be one of: 2 (input), 4 (output), 256 (json), or 512 (xml)."; }; "legacy-hierarchy-building-circular-reference": { default: "@hierarchyBuilding decorator causes recursive base type reference."; }; "legacy-hierarchy-building-conflict": { "property-type-mismatch": CallableMessage<["propertyName", "childModel", "parentModel", "childModel", "childModel"]>; }; "lro-operation-id-duplicate": { default: "@lroOperationId selects more than one source of the same kind on the linked status-monitor operation in the active emitter scope."; }; "lro-operation-id-invalid-target": { default: "@lroOperationId can only be applied to a path parameter of the linked status-monitor operation or a string-like property of its response model."; }; "lro-operation-id-missing-link": { default: "@lroOperationId requires the linked status-monitor operation to be reached through a response header or URL-valued body property."; }; "lro-status-metadata-structural-property": { default: CallableMessage<["role", "propertyName"]>; }; "mark-as-lro-ineffective": { default: CallableMessage<[]>; }; "mark-as-pageable-ineffective": { default: CallableMessage<[]>; }; "missing-scope": { default: CallableMessage<["decoratorName"]>; }; "missing-service-versions": { default: CallableMessage<["serviceName", "missingVersions"]>; }; "multiple-param-alias": { default: CallableMessage<["originalName", "firstParamAlias"]>; }; "multiple-response-types": { default: CallableMessage<["operation"]>; }; "nested-client-service-not-subset": { default: "Nested client's services must be a subset of the parent client's services. If no service is needed, omit the `service` property to inherit from the parent."; }; "no-corresponding-method-param": { default: CallableMessage<["paramName", "methodName"]>; }; "no-emitter-name": { default: "Can not find name for your emitter, please check your emitter name."; }; "non-head-bool-response-decorator": { default: CallableMessage<["operationName"]>; }; "override-parameters-mismatch": { default: CallableMessage<["methodName", "checkParameter"]>; }; "override-response-replacement": { default: CallableMessage<["methodName"]>; }; "remove-parameter-not-found": { default: CallableMessage<["paramName", "operationName"]>; }; "reorder-parameter-duplicate": { default: CallableMessage<["paramName", "operationName"]>; }; "reorder-parameter-missing": { default: CallableMessage<["paramName", "operationName"]>; }; "reorder-parameter-not-found": { default: CallableMessage<["paramName", "operationName"]>; }; "replace-parameter-not-found": { default: CallableMessage<["paramName", "operationName"]>; }; "require-versioned-service": { default: CallableMessage<["serviceName", "decoratorName"]>; }; "required-parameter-scoped-out": { default: CallableMessage<["paramName", "scope"]>; }; "root-client-missing-service": { default: "Root namespace decorated with @client must have service config."; }; "server-param-not-path": { default: CallableMessage<["templateArgumentName", "templateArgumentType"]>; }; "union-circular": { default: "Cannot have a union containing self."; }; "union-model-conversion-conflict": { default: CallableMessage<["unionName"]>; }; "union-model-discriminator-conflict": { default: CallableMessage<["unionName", "modelName"]>; }; "union-null": { default: "Cannot have a union containing only null types."; }; "unnecessary-emitter-option": { default: CallableMessage<["optionName", "emitterName"]>; }; "unsupported-generic-decorator-arg-type": { default: CallableMessage<["decoratorName"]>; }; "unsupported-kind": { default: CallableMessage<["kind"]>; }; "unsupported-protocol": { default: "Currently we only support HTTP and HTTPS protocols"; }; "wrong-client-decorator": { default: "@client should decorate namespace or interface in client.tsp"; }; }, C, M>

Diagnostic