Skip to content

Commit 914a191

Browse files
authored
fix retrieval of HttpApiSchema.param annotations (#5053)
1 parent 67dc270 commit 914a191

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.changeset/nasty-rats-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/platform": patch
3+
---
4+
5+
fix retrieval of HttpApiSchema.param annotations

packages/platform/src/HttpApiSchema.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,8 @@ export const getEncoding = (ast: AST.AST, fallback = encodingJson): Encoding =>
137137
* @category annotations
138138
*/
139139
export const getParam = (ast: AST.AST | Schema.PropertySignature.AST): string | undefined => {
140-
if (ast._tag === "PropertySignatureTransformation") {
141-
ast = ast.to.type
142-
}
143-
return (ast.annotations[AnnotationParam] as any)?.name as string | undefined
140+
const annotations = ast._tag === "PropertySignatureTransformation" ? ast.to.annotations : ast.annotations
141+
return (annotations[AnnotationParam] as any)?.name as string | undefined
144142
}
145143

146144
/**

0 commit comments

Comments
 (0)