@typespec/openapi3
Advanced tools
Comparing version 0.55.0-dev.3 to 0.55.0-dev.4
@@ -1,6 +0,7 @@ | ||
import { DecoratorContext, Model, ModelProperty, Program, Type, Union } from "@typespec/compiler"; | ||
export declare function $useRef(context: DecoratorContext, entity: Model | ModelProperty, refUrl: string): void; | ||
import { Program, Type } from "@typespec/compiler"; | ||
import { OneOfDecorator, UseRefDecorator } from "../generated-defs/TypeSpec.OpenAPI.js"; | ||
export declare const $useRef: UseRefDecorator; | ||
export declare function getRef(program: Program, entity: Type): string | undefined; | ||
export declare function $oneOf(context: DecoratorContext, entity: Union | ModelProperty): void; | ||
export declare const $oneOf: OneOfDecorator; | ||
export declare function getOneOf(program: Program, entity: Type): boolean; | ||
//# sourceMappingURL=decorators.d.ts.map |
import { createStateSymbol, reportDiagnostic } from "./lib.js"; | ||
const refTargetsKey = createStateSymbol("refs"); | ||
export function $useRef(context, entity, refUrl) { | ||
export const $useRef = (context, entity, refUrl) => { | ||
context.program.stateMap(refTargetsKey).set(entity, refUrl); | ||
} | ||
}; | ||
export function getRef(program, entity) { | ||
@@ -10,3 +10,3 @@ return program.stateMap(refTargetsKey).get(entity); | ||
const oneOfKey = createStateSymbol("oneOf"); | ||
export function $oneOf(context, entity) { | ||
export const $oneOf = (context, entity) => { | ||
if (entity.kind === "ModelProperty" && entity.type.kind !== "Union") { | ||
@@ -19,3 +19,3 @@ reportDiagnostic(context.program, { | ||
context.program.stateMap(oneOfKey).set(entity, true); | ||
} | ||
}; | ||
export function getOneOf(program, entity) { | ||
@@ -22,0 +22,0 @@ return program.stateMap(oneOfKey).get(entity); |
{ | ||
"name": "@typespec/openapi3", | ||
"version": "0.55.0-dev.3", | ||
"version": "0.55.0-dev.4", | ||
"author": "Microsoft Corporation", | ||
@@ -70,4 +70,5 @@ "description": "TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding", | ||
"clean": "rimraf ./dist ./temp", | ||
"build": "tsc -p . && npm run lint-typespec-library", | ||
"build": "npm run gen-extern-signature && tsc -p . && npm run lint-typespec-library", | ||
"watch": "tsc -p . --watch", | ||
"gen-extern-signature": "tspd --enable-experimental gen-extern-signature .", | ||
"lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit", | ||
@@ -74,0 +75,0 @@ "test": "vitest run", |
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
280300
49
3658