@typespec/http
Advanced tools
Comparing version 0.45.0-dev.3 to 0.45.0-dev.4
@@ -1,9 +0,9 @@ | ||
import { DecoratorContext, Model, ModelProperty, Namespace, Operation, Program, Tuple, Type, Union } from "@typespec/compiler"; | ||
import { DecoratorContext, Model, ModelProperty, Namespace, Operation, Program, StringLiteral, Tuple, Type, Union } from "@typespec/compiler"; | ||
import { HeaderFieldOptions, HttpVerb, PathParameterOptions, QueryParameterOptions, ServiceAuthentication } from "./types.js"; | ||
export declare const namespace = "TypeSpec.Http"; | ||
export declare function $header(context: DecoratorContext, entity: ModelProperty, headerNameOrOptions?: string | Model): void; | ||
export declare function $header(context: DecoratorContext, entity: ModelProperty, headerNameOrOptions?: StringLiteral | Model): void; | ||
export declare function getHeaderFieldOptions(program: Program, entity: Type): HeaderFieldOptions; | ||
export declare function getHeaderFieldName(program: Program, entity: Type): string; | ||
export declare function isHeader(program: Program, entity: Type): boolean; | ||
export declare function $query(context: DecoratorContext, entity: ModelProperty, queryNameOrOptions?: string | Model): void; | ||
export declare function $query(context: DecoratorContext, entity: ModelProperty, queryNameOrOptions?: StringLiteral | Model): void; | ||
export declare function getQueryParamOptions(program: Program, entity: Type): QueryParameterOptions; | ||
@@ -10,0 +10,0 @@ export declare function getQueryParamName(program: Program, entity: Type): string; |
@@ -14,4 +14,4 @@ import { createDiagnosticCollector, getDoc, isArrayModelType, reportDeprecated, setTypeSpecNamespace, typespecTypeToJson, validateDecoratorTarget, validateDecoratorUniqueOnNode, } from "@typespec/compiler"; | ||
if (headerNameOrOptions) { | ||
if (typeof headerNameOrOptions === "string") { | ||
options.name = headerNameOrOptions; | ||
if (headerNameOrOptions.kind === "String") { | ||
options.name = headerNameOrOptions.value; | ||
} | ||
@@ -59,4 +59,4 @@ else { | ||
if (queryNameOrOptions) { | ||
if (typeof queryNameOrOptions === "string") { | ||
options.name = queryNameOrOptions; | ||
if (queryNameOrOptions.kind === "String") { | ||
options.name = queryNameOrOptions.value; | ||
} | ||
@@ -63,0 +63,0 @@ else { |
{ | ||
"name": "@typespec/http", | ||
"version": "0.45.0-dev.3", | ||
"version": "0.45.0-dev.4", | ||
"author": "Microsoft Corporation", | ||
@@ -5,0 +5,0 @@ "description": "TypeSpec HTTP 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
210477