Co-authored-by: Mario Guerra <85648637+mario-guerra@users.noreply.github.com>
Co-authored-by: Libba Lawrence <llawrence@microsoft.com>
Co-authored-by: Allen Zhang <allenzhang@live.com>
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
Closes#2718
This change adds support for an optional message that emitters may use
to communicate the context of a pattern validation error.
I also added some baseline tests for `@pattern` since there were none in
decorators.spec.ts.
---------
Co-authored-by: Will Temple <will@wtemple.net>
Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
Fix#2497.
Clarifies which TypeSpec types these decorators can _actually_ be used
on by-design.
**BREAKING CHANGE** This is a breaking change because if unsupported
elements were previously decorated with these (i.e. Namespaces) those
will now throw an error.
fix [#2333](https://github.com/microsoft/typespec/issues/2333)
I went through the docs and copied the samples as I went to make sure
everything was working fine.
With `tsp compile . --watch` you get a nice result with this doc now.
---------
Co-authored-by: Mike Kistler <mikekistler@microsoft.com>
This PR tweaks the way that models are included in output specifications
when they are not referenced by operations and adds an option for
controlling this behavior.
The option is `omit-unreachable-types` after the OpenAPI v3 emitter
which uses the same name, and the behavior in the protobuf emitter is
similar. If a message is expliclty decorated with `@message` or is
referenced direclty or indirectly by an operation/method, it will be
emitted. Otherwise, it will be emitted if (1) it is a direct child of a
`package` namespace AND (2) ALL of its fields are annotated with
`@field` AND (3) the `omit-unreachable-types` option is not set to true.
Closes#1879
---------
Co-authored-by: Will Temple <will@wtemple.net>
This PR revises the logic for encodings on utcDateTime and
offsetDateTime to set the `format` to the `encoding` value for any
unrecognized values. For backward compatibility, a special case is added
for `rfc7231` which maps to `format: date-time-rfc7231`.
Tests and docs are updated.
## Update
Revised this PR to map rfc7231 to http-date in the openapi3 emitter.
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
fix#2130
Generate the README.md for typespec libraries automatically using the
subset of the content as what gets included in the ref doc
To achieve this I reoganized the markdown rendering to be able to
provide a reusable system that can be cusomized for different markdown
engines.
- The markdown renderer will render a markdown compatible with Github
Flavored Markdown.
- The docusuaurs rendererer extends the markdown renderer and include a
few extra metadata.
fix#2239
`useRef` decorator in openapi3 library was missing `valueof` for ref
paramater which led to it saving the `StringLiteral` object instead of
the actual ref string.
Progress towards providing the ref doc generation as a usable tool by
any typespec library.
Detach the generation from the website, instead each package define
where they want their doc and we generate it.
This adds a new `tspd` package and CLI tool that is meant to be used by
library authors. It will have the following functionalities
- generate docs
- generate TS signatures
- lint library?
---------
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
fix [#980](https://github.com/microsoft/typespec/issues/980)
Add new `@info` decorator providing the ability to specify the
additional fields from openapi info object.
---------
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
fix [#1029](https://github.com/microsoft/typespec/issues/1029)
Add an option `include-x-typespec-name` which can be 2 option:
- `inline-only` when a schema is inline (Previous behavior)
- `never` **DEFAULT**. Never included.
This change fixes#1978 by deprecating the virtually-unused `@list`
decorator in favor of the `@listsResource` decorator in
`@typespec/rest`. I'm also deprecating the associated `isListOperation`
and `getListOperationType` functions in `@typespec/compiler` and moving
`isListOperation` to the REST library.
The corresponding `typespec-azure` PR is here:
https://github.com/Azure/typespec-azure/pull/3200
---------
Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>