-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
EventGridv2 TypeSpec Api Preview #23204
Conversation
Hi, @l0lawrence Thanks for your PR. I am workflow bot for review process. Here are some small tips. Any feedback about review process or workflow bot, pls contact swagger and tools team. vscswagger@microsoft.com |
Swagger Validation Report
|
Rule | Message |
---|---|
Runtime Exception |
"new":"https://github.com/Azure/azure-rest-api-specs/blob/4b1d4a0e3b95152fb0aca665b17e9489c6f5749d/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json", "old":"https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json", "details":"Command failed: node "/mnt/vss/_work/_tasks/AzureApiValidation_5654d05d-82c1-48da-ad8f-161b817f6d41/0.0.54/common/temp/node_modules/.pnpm/@Azure+oad@0.10.4/node_modules/autorest/dist/app.js" --v2 --input-file=/mnt/vss/_work/1/cross-version-c93b354fd9c14905bb574a8834c4d69b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=old --output-folder=/tmp\nERROR: Schema violation: Additional properties not allowed: ?overload=customEvent, ?overload=cloudEvent, ?overload=EventGridEvent\n - file:///mnt/vss/_work/1/cross-version-c93b354fd9c14905bb574a8834c4d69b/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/EventGrid.json:33:2 ($["x-ms-paths"])\nFATAL: swagger-document/individual/schema-validator - FAILED\nFATAL: Error: [OperationAbortedException] Error occurred. Exiting.\nProcess() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.\n" |
️️✔️
CredScan succeeded [Detail] [Expand]
There is no credential detected.
️❌
LintDiff: 1 Errors, 27 Warnings failed [Detail]
compared tags (via openapi-validator v2.1.2) | new version | base version |
---|---|---|
package-2023-06-01-preview | package-2023-06-01-preview(4b1d4a0) | default(main) |
[must fix]The following errors/warnings are introduced by current PR:
Rule | Message | Related RPC [For API reviewers] |
---|---|---|
XmsPathsMustOverloadPaths |
Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L286 |
|
Security definition should have a description. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L43 |
||
Since operation response has model definition in array type, it should be of the form '_list'. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L52 |
||
Operation might be pageable. Consider adding the x-ms-pageable extension. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L52 |
||
Please provide x-ms-examples describing minimum/maximum property set for response/request payloads for operations. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L52 |
||
OperationId should be of the form 'Noun_Verb' Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L53 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L59 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L66 |
||
Operation might be pageable. Consider adding the x-ms-pageable extension. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L114 |
||
Please provide x-ms-examples describing minimum/maximum property set for response/request payloads for operations. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L114 |
||
OperationId should be of the form 'Noun_Verb' Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L115 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L121 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L128 |
||
Operation might be pageable. Consider adding the x-ms-pageable extension. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L171 |
||
Please provide x-ms-examples describing minimum/maximum property set for response/request payloads for operations. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L171 |
||
OperationId should be of the form 'Noun_Verb' Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L172 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L178 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L185 |
||
Operation might be pageable. Consider adding the x-ms-pageable extension. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L228 |
||
Please provide x-ms-examples describing minimum/maximum property set for response/request payloads for operations. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L228 |
||
OperationId should be of the form 'Noun_Verb' Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L229 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L235 |
||
Path parameter should specify a maximum length (maxLength) and characters allowed (pattern). Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L242 |
||
Please provide x-ms-examples describing minimum/maximum property set for response/request payloads for operations. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L287 |
||
Schema name should be Pascal case. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L386 |
||
Schema name should be Pascal case. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L422 |
||
Schema name should be Pascal case. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L435 |
||
Property should have a defined type. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L482 |
The following errors/warnings exist before current PR submission:
Rule | Message |
---|---|
Don't use x-ms-paths except where necessary to support legacy APIs. Location: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L285 |
️️✔️
Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️
ApiReadinessCheck succeeded [Detail] [Expand]
️⚠️
~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]
API Test is not triggered due to precheck failure. Check pipeline log for details.
️️✔️
SwaggerAPIView succeeded [Detail] [Expand]
️️✔️
CadlAPIView succeeded [Detail] [Expand]
️️✔️
TypeSpecAPIView succeeded [Detail] [Expand]
️❌
ModelValidation: 5 Errors, 0 Warnings failed [Detail]
Rule | Message |
---|---|
XMS_EXAMPLE_NOTFOUND_ERROR |
x-ms-example not found in ReceiveCloudEvents. Url: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L52:15 |
XMS_EXAMPLE_NOTFOUND_ERROR |
x-ms-example not found in AcknowledgeCloudEvents. Url: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L114:15 |
XMS_EXAMPLE_NOTFOUND_ERROR |
x-ms-example not found in ReleaseCloudEvents. Url: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L171:15 |
XMS_EXAMPLE_NOTFOUND_ERROR |
x-ms-example not found in RejectCloudEvents. Url: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L228:15 |
XMS_EXAMPLE_NOTFOUND_ERROR |
x-ms-example not found in PublishCloudEvents. Url: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L287:15 |
️❌
SemanticValidation: 1 Errors, 0 Warnings failed [Detail]
Rule | Message |
---|---|
MISSING_PATH_PARAMETER_DEFINITION |
Path parameter is declared but is not defined: apiVersion JsonUrl: Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json#L287:15 |
️️✔️
PoliCheck succeeded [Detail] [Expand]
Validation passed for PoliCheck.
️️✔️
PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️️✔️
SpellCheck succeeded [Detail] [Expand]
Validation passes for SpellCheck.
️️✔️
Lint(RPaaS) succeeded [Detail] [Expand]
Validation passes for Lint(RPaaS).
️️✔️
CadlValidation succeeded [Detail] [Expand]
Validation passes for CadlValidation.
️❌
TypeSpec Validation: 2 Errors, 20 Warnings failed [Detail]
Rule | Message |
---|---|
MissingExamplesDirectory |
"details":"The 'examples' directory is missing in the typespec folder specification/eventgrid/Azure.Messaging.EventGrid, please ensure the 'examples' is added in the PR." |
InConsistentSwagger |
"details":"The generated swagger file EventGrid.json from typespec specification/eventgrid/Azure.Messaging.EventGrid is not the same as the '/mnt/vss/_work/1/azure-rest-api-specs/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2017-06-15-preview/EventGrid.json' in PR, please make sure the swagger is consistent with the generated swagger. You can find the difference in the pipeline log." |
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L167 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L184 |
|
Azure services must not have properties of type unknown .Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L55 |
|
The names of Property types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L58 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L167 |
|
Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes. Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L195 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L184 |
|
Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes. Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L195 |
|
Request body should not be of raw array type. Consider creating a container model that can add properties over time to avoid introducing breaking changes. Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L195 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L203 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L227 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L251 |
|
The names of Operation types must use camelCase Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L274 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L167 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L184 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L167 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L184 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L167 |
|
The shared option is deprecated, use the @sharedRoute decorator instead.Location: specification/eventgrid/Azure.Messaging.EventGrid/main.tsp#L184 |
|
"details":"The configuration 'azure-resource-provider-folder' for '@azure-tools/typespec-autorest' is missing in the tspconfig.yaml under folder specification/eventgrid/Azure.Messaging.EventGrid, please ensure it is added in the configuration of the emitter '@azure-tools/typespec-autorest'." |
️️✔️
PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
Swagger Generation Artifacts
|
Generated ApiView
|
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.
Please include the generated OpenAPI in your PR.
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Co-authored-by: Libba Lawrence <llawrence@microsoft.com>
Co-authored-by: Libba Lawrence <llawrence@microsoft.com>
Swagger Generation Artifacts
|
* verioning fix * spacing mishap?
* deliveryCount 5/1 * small typo
* remove internal * remove client.tsp
@doc("Single Cloud Event being published.") | ||
@body | ||
event: CloudEvent; | ||
}, PublishResult>; |
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.
Why do we return an empty object? Can we just don't return anything?
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.
Is the service really returning {} as the body?
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.
The service does return a 200 with '{}'. Having the return as a model keeps everything consistent and if publish ever returns anything else the response type is already there
* encode * remove num default on duration --------- Co-authored-by: Laurent Mazuel <laurent.mazuel@gmail.com>
Hi @l0lawrence, Your PR has some issues. Please fix the CI sequentially by following the order of
|
Hi, @l0lawrence, For review efficiency consideration, when creating a new api version, it is required to place API specs of the base version in the first commit, and push new version updates into successive commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki. Or you could onboard API spec pipeline |
* regen off new commit for encode * reference preview tag * ignore word * update readme to have both apis * update with next autorest * change format to int32
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.
Merging, as this as good as we can get the CI to be given a few TypeSpec issues
See #23200