-
Notifications
You must be signed in to change notification settings - Fork 323
Decorator post validator #9104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Decorator post validator #9104
Conversation
@typespec/compiler
@typespec/events
@typespec/http
@typespec/http-client
@typespec/json-schema
@typespec/openapi
@typespec/openapi3
@typespec/protobuf
@typespec/rest
@typespec/spector
@typespec/sse
@typespec/streams
@typespec/tspd
@typespec/versioning
@typespec/xml
commit: |
|
All changed packages have been documented.
Show changes
|
packages/compiler/src/core/types.ts
Outdated
| readonly kind: "postSelf" | "post"; | ||
|
|
||
| /** Validator implementation. This function will be run according to the kind defined above. */ | ||
| readonly validator: () => readonly Diagnostic[]; |
There was a problem hiding this comment.
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?
|
You can try these changes here
|
.chronus/changes/decorator-post-validator-2025-11-1-16-26-16.md
Outdated
Show resolved
Hide resolved
| } | ||
| ``` | ||
|
|
||
| ### Decorator validation |
There was a problem hiding this comment.
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.
fix #8669
TODO: