Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@typespec/openapi3
Advanced tools
TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding
TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding
npm install @typespec/openapi3
tsp compile . --emit=@typespec/openapi3
emit:
- "@typespec/openapi3"
file-type
Type: "yaml" | "json"
If the content should be serialized as YAML or JSON. Default 'yaml', it not specified infer from the output-file
extension
output-file
Type: string
Name of the output file. Output file will interpolate the following values:
Default: {service-name}.{version}.openapi.yaml
or .json
if file-type
is "json"
Example Single service no versioning
openapi.yaml
Example Multiple services no versioning
openapi.Org1.Service1.yaml
openapi.Org1.Service2.yaml
Example Single service with versioning
openapi.v1.yaml
openapi.v2.yaml
Example Multiple service with versioning
openapi.Org1.Service1.v1.yaml
openapi.Org1.Service1.v2.yaml
openapi.Org1.Service2.v1.0.yaml
openapi.Org1.Service2.v1.1.yaml
new-line
Type: "crlf" | "lf"
Set the newline character for emitting files.
omit-unreachable-types
Type: boolean
Omit unreachable types. By default all types declared under the service namespace will be included. With this flag on only types references in an operation will be emitted.
include-x-typespec-name
Type: "inline-only" | "never"
If the generated openapi types should have the x-typespec-name
extension set with the name of the TypeSpec type that created it.
This extension is meant for debugging and should not be depended on.
@oneOf
Specify that oneOf
should be used instead of anyOf
for that union.
@TypeSpec.OpenAPI.oneOf
Union
None
@useRef
Specify an external reference that should be used inside of emitting this type.
@TypeSpec.OpenAPI.useRef(ref: valueof string)
union Model | ModelProperty
Name | Type | Description |
---|---|---|
ref | valueof scalar string | External reference(e.g. "../../common.json#/components/schemas/Foo") |
FAQs
TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding and converting OpenAPI3 to TypeSpec
We found that @typespec/openapi3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.