@typespec/openapi3
Advanced tools
Comparing version 0.57.0-dev.4 to 0.57.0-dev.5
@@ -158,2 +158,8 @@ import { JSONSchemaType } from "@typespec/compiler"; | ||
}; | ||
readonly "invalid-model-property": { | ||
readonly severity: "error"; | ||
readonly messages: { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
}; | ||
readonly "unsupported-auth": { | ||
@@ -219,2 +225,5 @@ readonly severity: "warning"; | ||
}; | ||
"invalid-model-property": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
"unsupported-auth": { | ||
@@ -224,3 +233,3 @@ readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; | ||
}, OpenAPI3EmitterOptions, never>; | ||
export declare const createDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "unsupported-auth", M extends keyof { | ||
export declare const createDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "invalid-model-property" | "unsupported-auth", M extends keyof { | ||
"oneof-union": { | ||
@@ -274,2 +283,5 @@ readonly default: "@oneOf decorator can only be used on a union or a model property which type is a union."; | ||
}; | ||
"invalid-model-property": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
"unsupported-auth": { | ||
@@ -327,6 +339,9 @@ readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; | ||
}; | ||
"invalid-model-property": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
"unsupported-auth": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; | ||
}; | ||
}, C, M>) => import("@typespec/compiler").Diagnostic, reportDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "unsupported-auth", M extends keyof { | ||
}, C, M>) => import("@typespec/compiler").Diagnostic, reportDiagnostic: <C extends "oneof-union" | "inconsistent-shared-route-request-visibility" | "invalid-server-variable" | "invalid-format" | "resource-namespace" | "path-query" | "duplicate-header" | "status-code-in-default-response" | "invalid-schema" | "union-null" | "empty-union" | "empty-enum" | "enum-unique-type" | "invalid-default" | "inline-cycle" | "unsupported-status-code-range" | "invalid-model-property" | "unsupported-auth", M extends keyof { | ||
"oneof-union": { | ||
@@ -380,2 +395,5 @@ readonly default: "@oneOf decorator can only be used on a union or a model property which type is a union."; | ||
}; | ||
"invalid-model-property": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
"unsupported-auth": { | ||
@@ -433,2 +451,5 @@ readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; | ||
}; | ||
"invalid-model-property": { | ||
readonly default: import("@typespec/compiler").CallableMessage<["type"]>; | ||
}; | ||
"unsupported-auth": { | ||
@@ -435,0 +456,0 @@ readonly default: import("@typespec/compiler").CallableMessage<["authType"]>; |
@@ -175,2 +175,8 @@ import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler"; | ||
}, | ||
"invalid-model-property": { | ||
severity: "error", | ||
messages: { | ||
default: paramMessage `'${"type"}' cannot be specified as a model property.`, | ||
}, | ||
}, | ||
"unsupported-auth": { | ||
@@ -177,0 +183,0 @@ severity: "warning", |
@@ -214,3 +214,10 @@ import { compilerAssert, explainStringTemplateNotSerializable, getDeprecated, getDiscriminatedUnion, getDiscriminator, getDoc, getEncode, getFormat, getKnownValues, getMaxItems, getMaxLength, getMaxValue, getMaxValueExclusive, getMinItems, getMinLength, getMinValue, getMinValueExclusive, getNamespaceFullName, getPattern, getSummary, getTypeName, ignoreDiagnostics, isArrayModelType, isNeverType, isNullType, isSecret, isTemplateDeclaration, resolveEncodedName, } from "@typespec/compiler"; | ||
if (refSchema.kind !== "code") { | ||
throw new Error("Unexpected non-code result from emit reference"); | ||
reportDiagnostic(program, { | ||
code: "invalid-model-property", | ||
format: { | ||
type: prop.type.kind, | ||
}, | ||
target: prop, | ||
}); | ||
return {}; | ||
} | ||
@@ -217,0 +224,0 @@ const isRef = refSchema.value instanceof Placeholder || "$ref" in refSchema.value; |
{ | ||
"name": "@typespec/openapi3", | ||
"version": "0.57.0-dev.4", | ||
"version": "0.57.0-dev.5", | ||
"author": "Microsoft Corporation", | ||
@@ -5,0 +5,0 @@ "description": "TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
278412
3763