typespec

TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec

MIT License

Downloads
903.5K
Stars
4.4K
Committers
93

Bot releases are visible (Hide)

typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

Bug Fixes

  • #4420 Fix: Numeric values defined with e-notation incorrectly resolved
typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

Bug Fixes

  • #4408 Fixes versioning when using versioned named union variants
typespec - [email protected]

Published by azure-sdk about 1 month ago

@typespec/compiler

Bug Fixes

  • #4381 Fix Semantic walker doesn't fire exitOperation or exitModelProperty
  • #4146 Fix model expression defined in alias will resolve its namespace from the namespace where the alias was declared
  • #4147 Fix examples with models using extends
  • #4144 Fix: Model and union expression in template were not considered as template instances
  • #4135 Fix numeric 0 stringify producing 0.0
  • #4064 IDE: Formatting command will use prettier config if provided over the editor's configuration.
  • #4089 Fix tmlanguage for named type argument in type reference.
  • #4324 API: Extract source resolution logic into its own source loader

Features

  • #4139 Add new way to define decorator implementation with $decorators export.
export const $decorators = {
  "TypeSpec.OpenAPI": {
    useRef: $useRef,
    oneOf: $oneOf,
  },
};
  • #4148 Diagnostics logged to the terminal now have a clickable hyperlink to the diagnostic documentation url if applicable.
  • #4141 Diagnostic code in IDE now link to the linter rule documentation url if applicable
  • #4357 Improvements to type relation errors: Show stack when it happens in a nested property otherwise show up in the correct location.

@typespec/http

Bug Fixes

  • #4322 Use user provided description of model if model has a status code property(detect it as an response envelope)

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/versioning

Bug Fixes

  • #4145 Fix error when trying to reference types from another sub namespace of a versioned namespace
  • #4179 Add validation to make sure operation params reference models available in the current version
  • #4179 Add validation to make sure types referencing array in union types have compatible versioning.

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/rest

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/openapi

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/openapi3

Bug Fixes

  • #4133 Fix Bug for OpenAPI 3 Emitter crash on @useAuth({})
  • #4123 Fix OpenAPI3 union names when declared within a namespace
  • #4216 Fixes issue in tsp-openapi3 that resulted in component schemas and parameters with the same name being merged into a single TypeSpec data type.
  • #4232 Improves tsp-openapi3 model generation from schemas utilizing allOf. Models will now extend an allOf member if it is a schema reference and the only member with a discriminator. Other members will be spread into the model if defined as a schema reference, or have their properties treated as top-level properties if they are an inline-schema.
  • #4149 Updates tsp-openapi3 conversion of OpenAPI3 component schemas to improve handling of enums, unions, scalars, and aliases.

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/protobuf

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/prettier-plugin-typespec

No changes, version bump only.

@typespec/eslint-plugin

No changes, version bump only.

@typespec/html-program-viewer

Bug Fixes

  • #4353 Fix crash when using anonymous union variant
  • #4136 Fix namespace with the same name conflicting in the tree navigation

@typespec/json-schema

Bug Fixes

  • #4150 Stop json schema from crashing on unknown scalar and handle unixTimestamp32

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation

@typespec/internal-build-utils

No changes, version bump only.

typespec-vs

No changes, version bump only.

typespec-vscode

No changes, version bump only.

@typespec/library-linter

No changes, version bump only.

typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

Features

  • #4139 Internals: Migrate to new api for declaring decorator implementation
typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

Bug Fixes

  • #4276 Accessibility, increase footer contrast
  • #4081 Fix: Reloading the playground will not register the typespec language server
typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

No changes, version bump only.

typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

No changes, version bump only.

typespec - @typespec/[email protected]

Published by azure-sdk about 1 month ago

Bug Fixes

  • #4139 Allow bundling libraries that don't import their main file from the TypeSpec
typespec - @typespec/[email protected] Latest Release

Published by azure-sdk 2 months ago

Bug Fixes

  • #4173 Fix: Revert unix-style warning that was preventing windows path via the CLI as well
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bug Fixes

  • #4168 Fix: query params are explode: true by default in OpenAPI 3.0
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bug Fixes

  • #4155 HotFix: Uri template not correctly built when using @autoRoute
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bug Fixes

  • #4155 HotFix: Uri template not correctly built when using @autoRoute
typespec - [email protected]

Published by azure-sdk 2 months ago

@typespec/compiler

Bug Fixes

  • #3881 Fixes a bug where ending a non-terminal line in a multi-line comment with a backslash caused the next star to show up in the parsed doc string.
  • #4050 Allow using compact namespace form Foo.Bar when inside another namespace
    namespace MyOrg.MyProject {
      namespace MyModule.MySubmodule { // <-- this used to emit an error
        // ...
      }
    }
    
  • #3898 Fix decimal numeric with leading zeros
  • #4046 Fix type comparison of literal and scalar when in projection context
  • #4022 tsp compile --watch will not stop when a crash happens during compilation
  • #3933 Add const template parameter to get the precise lib type

Bump dependencies

  • #3948 Update dependencies

Features

  • #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

Breaking Changes

  • #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 {}
    }
    

@typespec/http

Bug Fixes

  • #3909 Fix HttpPart not respecting explicit part name by always using the property name
  • #3933 Fix some diagnostic not showing the right message

Bump dependencies

  • #3948 Update dependencies

Features

  • #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;
    

Deprecations

  • #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[];
    

@typespec/versioning

Bug Fixes

  • #3911 Allow spreading a model that has props added in previous version
  • #3951 Fixes issue where spreading a versioned model as a parameter to an incompatible versioned operation would cause the compiler to crash.

Bump dependencies

  • #3948 Update dependencies

@typespec/rest

Bump dependencies

  • #3948 Update dependencies

Features

  • #3932 Add support for URI templates in routes

@typespec/openapi

Bump dependencies

  • #3948 Update dependencies

@typespec/openapi3

Bug Fixes

  • #4046 Fix issue where operation example would produce an empty object when @body/@bodyRoot was used
  • #4046 Fix operation response body examples showing up for each response.
  • #3912 Fixes bug where union documentation was being applied to each union member in emitted output.
  • #3908 Fixes bug where circular references in unions caused an empty object to be emitted instead of a ref.

Bump dependencies

  • #3948 Update dependencies

Features

  • #3894 Add support for @useRef on responses
  • #4020 Add support for encoding numeric types as string
  • #3890 @extension used on the service namespace will set extension at the root of the document
  • #3932 Add support for URI templates in routes

@typespec/protobuf

Bug Fixes

  • #3933 Fix some diagnostic not showing the right message

Bump dependencies

  • #3948 Update dependencies

@typespec/prettier-plugin-typespec

Bump dependencies

  • #3948 Update dependencies

@typespec/eslint-plugin

Bump dependencies

  • #3948 Update dependencies

@typespec/html-program-viewer

Bump dependencies

  • #3948 Update dependencies

@typespec/json-schema

Bump dependencies

  • #3948 Update dependencies

Breaking Changes

  • #3558 Updates @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 {}

@typespec/internal-build-utils

Bump dependencies

  • #3948 Update dependencies

typespec-vs

Bug Fixes

  • #4115 Fixed a router bug where paths would sometimes fail to match after a parameter was bound.

typespec-vscode

Bump dependencies

  • #3948 Update dependencies

@typespec/library-linter

Bump dependencies

  • #3948 Update dependencies
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bump dependencies

  • #3948 Update dependencies

Features

  • #4020 Add support for encoding numeric types as string
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bump dependencies

  • #3948 Update dependencies
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bug Fixes

  • #3933 Fix some diagnostic not showing the right message
  • #4101 Fixed enum representation, an edge case with optional parameter joining, and a couple of type errors around query/header params.
  • #4115 Fixed a router bug where paths would sometimes fail to match after a parameter was bound.

Bump dependencies

  • #3948 Update dependencies
typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

No changes, version bump only.

typespec - @typespec/[email protected]

Published by azure-sdk 2 months ago

Bump dependencies

  • #3948 Update dependencies
typespec - [email protected]

Published by azure-sdk 2 months ago

Bump dependencies

  • #3948 Update dependencies
typespec - @typespec/[email protected]

Published by azure-sdk 3 months ago

Package Rankings
Top 2.41% on Npmjs.org
Badges
Extracted from project README
Related Projects