(schema: Schema.Top, method: HttpMethod)
| 1742 | } |
| 1743 | |
| 1744 | function transformPayload(schema: Schema.Top, method: HttpMethod): Schema.Top { |
| 1745 | if (!hasBody(method)) return toCodecHttpProperties(schema) |
| 1746 | const encoding = HttpApiSchema.getPayloadEncoding(schema.ast, method) |
| 1747 | switch (encoding._tag) { |
| 1748 | case "Json": |
| 1749 | return Schema.toCodecJson(schema) |
| 1750 | case "FormUrlEncoded": |
| 1751 | return Schema.toCodecStringTree(schema) |
| 1752 | case "Text": |
| 1753 | case "Uint8Array": |
| 1754 | case "Multipart": |
| 1755 | return schema |
| 1756 | } |
| 1757 | } |
| 1758 | |
| 1759 | /** |
| 1760 | * Creates a `GET` endpoint declaration. |
nothing calls this directly
no test coverage detected