Skip to content

Conversation

@timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Nov 26, 2025

fix #8669

TODO:

  • Developper docs
  • resolve how to define

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2025

Open in StackBlitz

@typespec/compiler

npm i https://pkg.pr.new/microsoft/typespec/@typespec/compiler@9104

@typespec/events

npm i https://pkg.pr.new/microsoft/typespec/@typespec/events@9104

@typespec/http

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9104

@typespec/http-client

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@9104

@typespec/json-schema

npm i https://pkg.pr.new/microsoft/typespec/@typespec/json-schema@9104

@typespec/openapi

npm i https://pkg.pr.new/microsoft/typespec/@typespec/openapi@9104

@typespec/openapi3

npm i https://pkg.pr.new/microsoft/typespec/@typespec/openapi3@9104

@typespec/protobuf

npm i https://pkg.pr.new/microsoft/typespec/@typespec/protobuf@9104

@typespec/rest

npm i https://pkg.pr.new/microsoft/typespec/@typespec/rest@9104

@typespec/spector

npm i https://pkg.pr.new/microsoft/typespec/@typespec/spector@9104

@typespec/sse

npm i https://pkg.pr.new/microsoft/typespec/@typespec/sse@9104

@typespec/streams

npm i https://pkg.pr.new/microsoft/typespec/@typespec/streams@9104

@typespec/tspd

npm i https://pkg.pr.new/microsoft/typespec/@typespec/tspd@9104

@typespec/versioning

npm i https://pkg.pr.new/microsoft/typespec/@typespec/versioning@9104

@typespec/xml

npm i https://pkg.pr.new/microsoft/typespec/@typespec/xml@9104

commit: 5cc0ee7

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

All changed packages have been documented.

  • @typespec/compiler
  • @typespec/events
  • @typespec/http-client
  • @typespec/http
  • @typespec/json-schema
  • @typespec/openapi
  • @typespec/openapi3
  • @typespec/protobuf
  • @typespec/rest
  • @typespec/spector
  • @typespec/sse
  • @typespec/streams
  • @typespec/tspd
  • @typespec/versioning
  • @typespec/xml
Show changes

@typespec/events - internal ✏️

Regenerate signature

@typespec/http-client - internal ✏️

Regenerate signature

@typespec/http - internal ✏️

Regenerate signature

@typespec/json-schema - internal ✏️

Regenerate signature

@typespec/openapi - internal ✏️

Regenerate signature

@typespec/openapi3 - internal ✏️

Regenerate signature

@typespec/protobuf - internal ✏️

Regenerate signature

@typespec/rest - internal ✏️

Regenerate signature

@typespec/spector - internal ✏️

Regenerate signature

@typespec/sse - internal ✏️

Regenerate signature

@typespec/streams - internal ✏️

Regenerate signature

@typespec/tspd - internal ✏️

Regenerate signature

@typespec/versioning - internal ✏️

Regenerate signature

@typespec/xml - internal ✏️

Regenerate signature

@typespec/compiler - feature ✏️

[API] Introduction of decorator validator callbacks. A decorator can define some callbacks to achieve some deferred validation (After the type is finished or the whole graph is)

readonly kind: "postSelf" | "post";

/** Validator implementation. This function will be run according to the kind defined above. */
readonly validator: () => readonly Diagnostic[];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now have this expecting an array of diagnostic, this feels nicer that always expecting it to be reported to the program but also less consistent with the rest. It also doesn't pervent you from directly reporting to program if you prefer. What do people think?

@azure-sdk
Copy link
Collaborator

azure-sdk commented Nov 26, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

}
```

### Decorator validation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we ought to have a strong warning in here about not mutating the type graph during validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability for decorators to register a post check validator

3 participants