@aklinker1/zeta 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/open-api.ts +8 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aklinker1/zeta",
3
3
  "description": "Composable, testable, OpenAPI-first backend framework with validation built-in",
4
- "version": "1.2.3",
4
+ "version": "1.2.4",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "packageManager": "bun@1.3.2",
package/src/open-api.ts CHANGED
@@ -35,7 +35,11 @@ export function buildOpenApiDocs(
35
35
  };
36
36
  for (const [method, methodEntry] of Object.entries(app["~zeta"].routes)) {
37
37
  for (const [path, routerData] of Object.entries(methodEntry)) {
38
- const openApiPath = path.replace(/\/:([^/]+)/g, "/{$1}");
38
+ const openApiPath = path
39
+ // Replace parameters with OpenAPI format
40
+ .replace(/\/:([^/]+)/g, "/{$1}")
41
+ // Remove trailing slash
42
+ .replace(/\/$/, "");
39
43
  const { headers, params, query, body, responses, ...openApiOperation } =
40
44
  routerData.def ?? {};
41
45
  docs.paths ??= {};
@@ -139,9 +143,10 @@ function mapParameters(
139
143
 
140
144
  return adapter
141
145
  .parseParamsRecord(schema)
142
- .map(({ schema, optional, ...param }) => ({
143
- ...param,
146
+ .map(({ schema, optional, description, name }) => ({
147
+ name,
144
148
  in: _in,
149
+ description,
145
150
  schema: adapter.toJsonSchema(schema),
146
151
  required: !optional,
147
152
  }));