-
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
|
|
||
| /** 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.
open to suggestion on the property names, the union values as well as a good way to have a oneliner function to build this object
// 1
const myDec: MyDecDecorator = (contex, target) => {
return context.validate.postSelf(() => {
// ....
})
}
// 2
const myDec: MyDecDecorator = (contex, target) => {
return DecoratorPostValidator.postSelf(() => {
// ....
})
}
// 3
const myDec: MyDecDecorator = (contex, target) => {
return postSelf(() => {
// ....
})
}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.
Current name suggestions "onFinish" | "onGraphFinish"
@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: |
|
❌ There is undocummented changes. Run The following packages have changes but are not documented.
The following packages have already been documented:
Show changes
|
| 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
|
fix #8669
TODO: