TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec
MIT License
Bot releases are hidden (Show)
Published by azure-sdk about 1 month ago
Published by azure-sdk about 1 month ago
Published by azure-sdk about 1 month ago
extends
$decorators
export.export const $decorators = {
"TypeSpec.OpenAPI": {
useRef: $useRef,
oneOf: $oneOf,
},
};
@useAuth({})
No changes, version bump only.
No changes, version bump only.
unixTimestamp32
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
No changes, version bump only.
Published by azure-sdk about 1 month ago
Published by azure-sdk about 1 month ago
Published by azure-sdk about 1 month ago
No changes, version bump only.
Published by azure-sdk about 1 month ago
No changes, version bump only.
Published by azure-sdk about 1 month ago
main
file from the TypeSpecunix-style
warning that was preventing windows path via the CLI as wellPublished by azure-sdk 2 months ago
explode: true
by default in OpenAPI 3.0Published by azure-sdk 2 months ago
@autoRoute
Published by azure-sdk 2 months ago
@autoRoute
Published by azure-sdk 2 months ago
Foo.Bar
when inside another namespace
namespace MyOrg.MyProject {
namespace MyModule.MySubmodule { // <-- this used to emit an error
// ...
}
}
tsp compile --watch
will not stop when a crash happens during compilationconst
template parameter to get the precise lib type#3906 Support completion for template parameter extending model or object value
Example
model User<T extends {name: string, age: int16}> {
}
alias user = User< {┆
| [age]
| [name]
#4020 Add support for encoding numeric types as string
#4023 Warn when using \
in config file field that expect a path.
#3932 Add ArrayEncoding
enum to define simple serialization of arrays
#4050 Fix issue where naming a namespace with the same name as the blockless namespace would merge with it instead of creating a subnamespace like any other name would.
namespace MyOrg.MyProject;
namespace MyOrg.MyProject.MyArea {
model A {}
}
namespace MyArea2 {
model B {}
}
Previously model A
would end-up in namespace MyOrg.MyProject.MyArea
and model B
in MyOrg.MyProject.MyArea2
. With this change model A
will now be in MyOrg.MyProject.MyOrg.MyProject.MyArea
. To achieve the previous behavior the above code should be written as:
namespace MyOrg.MyProject;
namespace MyArea {
model A {}
}
namespace MyArea2 {
model B {}
}
HttpPart
not respecting explicit part name by always using the property name#4046 API: Expose properties: HttpProperty[]
on operation parameter and response which reference all the properties of interest(Body, statusCode, contentType, implicitBodyProperty, etc.)
#3932 @route
can now take a uri template as defined by RFC-6570
@route("files{+path}") download(path: string): void;
#3932 API deprecation: HttpOperation#pathSegments
is deprecated. Use HttpOperation#uriTemplate
instead.
#3932 Deprecated @query({format: })
option. Use @query(#{explode: true})
instead of form
or multi
format. Previously csv
/simple
is the default now.
Decorator is also expecting an object value now instead of a model. A deprecation warning with a codefix will help migrating.
- @query({format: "form"}) select: string[];
+ @query(#{explode: true}) select: string[];
@body
/@bodyRoot
was used@useRef
on responses@extension
used on the service namespace will set extension at the root of the document@extension
decorator to support TypeSpec values in addition to types.In previous versions of the json-schema emitter, the @extension
decorator only accepted types as the value. These are emitted as JSON schemas. In order to add extensions as raw values, types had to be wrapped in the Json<>
template when being passed to the @extension
decorator.
This change allows setting TypeSpec values (introduced in TypeSpec 0.57.0) directly instead.
The following example demonstrates using values directly:
@extension("x-example", #{ foo: "bar" })
model Foo {}
This change results in scalars being treated as values instead of types. This will result in the @extension
decorator emitting raw values for scalar types instead of JSON schema. To preserve the previous behavior, use typeof
when passing in a scalar value.
The following example demonstrates how to pass a scalar value that emits a JSON schema:
@extension("x-example", "foo")
model Foo {}
To preserve this same behavior, the above example can be updated to the following:
@extension("x-example", typeof "foo")
model Foo {}
Published by azure-sdk 2 months ago
Published by azure-sdk 2 months ago
Published by azure-sdk 2 months ago
Published by azure-sdk 2 months ago
No changes, version bump only.
Published by azure-sdk 2 months ago
Published by azure-sdk 2 months ago
Published by azure-sdk 3 months ago