You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/6.x/node.md
+12-2
Original file line number
Diff line number
Diff line change
@@ -122,6 +122,16 @@ Resultant diff with correctly-typed `file` property:
122
122
+ file?:Blob;
123
123
```
124
124
125
-
Any [Schema Object](https://spec.openapis.org/oas/latest.html#schema-object) present in your schema will be run through this formatter (even remote ones!). Also be sure to check the `metadata` parameter for additional context that may be helpful.
125
+
#### transform / postTransform metadata
126
126
127
-
There are many other uses for this besides checking `format`. Because this must return a **string** you can produce any arbitrary TypeScript code you’d like (even your own custom types).
127
+
Any [Schema Object](https://spec.openapis.org/oas/latest.html#schema-object) present in your schema will be run through `transform`, prior to its conversion to a TypeScript AST node, and `postTransform` after its conversion, including remote schemas!
128
+
129
+
The `metadata` parameter present on both `transform` and `postTransform` has additional context that may be helpful.
130
+
131
+
| Property | Description |
132
+
|-|-|
133
+
| `metadata.path` | A [`$ref`](https://json-schema.org/understanding-json-schema/structuring#dollarref) URI string, pointing to the current schema object |
134
+
| `metadata.schema` | The schema object being transformed (only present for `postTransform`) |
135
+
| `metadata.ctx` | The GlobalContext object, containing
136
+
137
+
There are many other uses for this besides checking `format`. Because `tranform` may return a **string** you can produce any arbitrary TypeScript code you’d like (even your own custom types).
0 commit comments