@typespec/json-schema 0.46.0-dev.10 → 0.46.0-dev.11
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.
- package/lib/main.tsp +7 -2
- package/package.json +1 -1
package/lib/main.tsp
CHANGED
|
@@ -96,7 +96,7 @@ extern dec prefixItems(target: unknown[] | Reflection.ModelProperty, value: unkn
|
|
|
96
96
|
/**
|
|
97
97
|
* Specify the content type of content stored in a string.
|
|
98
98
|
*
|
|
99
|
-
* @param the media type of the string contents
|
|
99
|
+
* @param value the media type of the string contents
|
|
100
100
|
*
|
|
101
101
|
*/
|
|
102
102
|
extern dec contentMediaType(target: string | Reflection.ModelProperty, value: valueof string);
|
|
@@ -117,10 +117,13 @@ extern dec contentSchema(target: string | Reflection.ModelProperty, value: unkno
|
|
|
117
117
|
* emit the raw JSON code `{x: "value"}`.
|
|
118
118
|
*
|
|
119
119
|
* @param key the name of the keyword of vendor extension, e.g. `x-custom`.
|
|
120
|
-
* @param value the value of the keyword. Will be converted to a schema unless wrapped in Json<T
|
|
120
|
+
* @param value the value of the keyword. Will be converted to a schema unless wrapped in `Json<T>`.
|
|
121
121
|
*/
|
|
122
122
|
extern dec extension(target: unknown, key: valueof string, value: unknown);
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Well-known JSON Schema formats.
|
|
126
|
+
*/
|
|
124
127
|
enum Format {
|
|
125
128
|
dateTime: "date-time",
|
|
126
129
|
date: "date",
|
|
@@ -148,6 +151,8 @@ enum Format {
|
|
|
148
151
|
* `@extension("x-schema", { x: "value" })` will emit a JSON schema value for `x-schema`,
|
|
149
152
|
* whereas `@extension("x-schema", Json<{x: "value"}>)` will emit the raw JSON code
|
|
150
153
|
* `{x: "value"}`.
|
|
154
|
+
*
|
|
155
|
+
* @template T the type to convert to raw JSON
|
|
151
156
|
*/
|
|
152
157
|
@Private.validatesRawJson(T)
|
|
153
158
|
model Json<T> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/json-schema",
|
|
3
|
-
"version": "0.46.0-dev.
|
|
3
|
+
"version": "0.46.0-dev.11",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec",
|
|
6
6
|
"homepage": "https://github.com/microsoft/typespec",
|