[Cognitive Services - Azure AI Content Safety] GA Restful API#25498
[Cognitive Services - Azure AI Content Safety] GA Restful API#25498mengaims merged 18 commits intoAzure:mainfrom
Conversation
Next Steps to Merge✔️ All automated merging requirements have been met! Refer to step 4 in the PR workflow diagram (even if your PR is for data plane, not ARM). |
Swagger Validation Report
|
| compared swaggers (via Oad v0.10.4)] | new version | base version |
|---|---|---|
| contentsafety.json | 2023-10-01(7994379) | 2023-04-30-preview(main) |
The following breaking changes are detected by comparison with the latest preview version:
️️✔️CredScan succeeded [Detail] [Expand]
There is no credential detected.
️❌LintDiff: 2 Errors, 8 Warnings failed [Detail]
| compared tags (via openapi-validator v2.1.6) | new version | base version |
|---|---|---|
| package-2023-10-01 | package-2023-10-01(7994379) | default(main) |
[must fix]The following errors/warnings are introduced by current PR:
| Rule | Message | Related RPC [For API reviewers] |
|---|---|---|
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L404 |
|
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L462 |
|
| Security definition should have a description. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L51 |
||
| Operation might be pageable. Consider adding the x-ms-pageable extension. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L63 |
||
| Operation might be pageable. Consider adding the x-ms-pageable extension. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L298 |
||
| Parameter should have a description. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L315 |
||
| Parameter should have a description. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L369 |
||
| Path parameter should specify characters allowed (pattern). Location: ContentSafety/stable/2023-10-01/contentsafety.json#L478 |
||
| Operation might be pageable. Consider adding the x-ms-pageable extension. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L515 |
||
| Booleans properties are not descriptive in all cases and can make them to use, evaluate whether is makes sense to keep the property as boolean or turn it into an enum. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L685 |
The following errors/warnings exist before current PR submission:
| Rule | Message |
|---|---|
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L110 |
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L150 |
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L194 |
OperationIdNounVerb |
Per the Noun_Verb convention for Operation Ids, the noun 'TextBlocklists' should not appear after the underscore. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L256 |
| Security definition should have a description. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L46 |
|
| 'PATCH' operation 'TextBlocklists_CreateOrUpdateTextBlocklist' should use method name 'Update'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L194 |
|
| Schema name should be Pascal case. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L748 |
|
| Schema name should be Pascal case. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L782 |
|
| Schema name should be Pascal case. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L795 |
|
| Schema should have a description or title. Location: ContentSafety/stable/2023-10-01/contentsafety.json#L1046 |
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️SwaggerAPIView succeeded [Detail] [Expand]
️️✔️TypeSpecAPIView succeeded [Detail] [Expand]
️❌ModelValidation: 2 Errors, 0 Warnings failed [Detail]
| Rule | Message |
|---|---|
OBJECT_MISSING_REQUIRED_PROPERTY |
Missing required property: blocklistItemId Url: ContentSafety/stable/2023-10-01/contentsafety.json#L962:26 ExampleUrl: stable/2023-10-01/examples/AddOrUpdateBlocklistItems.json#L7:13 |
OBJECT_MISSING_REQUIRED_PROPERTY |
Missing required property: blocklistItemId Url: ContentSafety/stable/2023-10-01/contentsafety.json#L962:26 ExampleUrl: stable/2023-10-01/examples/AddOrUpdateBlocklistItems.json#L7:13 |
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️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).
️️✔️PR Summary succeeded [Detail] [Expand]
Validation passes for Summary.
️️✔️Automated merging requirements met succeeded [Detail] [Expand]
Swagger Generation Artifacts
|
Generated ApiView
|
|
Please fix ModelValidation CI. It all about example JSON. The 2 in LintDiff about operationId can be suppressed. |
OK, I see, the ModelValidation probably another issue of mismatch of TSP and Swagger. In this case, I am wondering whether we should remove |
I used to removed "blocklistItemId", but ModelValidation still report errors that required field missing. I think I can remove them, but can we ignore the required field missing error? In service implementation, even user set blocklistItemId in request, we will still ignore this field. |
| @doc("The response of adding blocklistItems to the text blocklist.") | ||
| model AddOrUpdateTextBlocklistItemsResult { | ||
| @doc("Array of blocklistItems have been added.") | ||
| blocklistItems?: TextBlocklistItem[]; |
There was a problem hiding this comment.
nit, any reason why blocklistItems array is optional?
There was a problem hiding this comment.
I think blocklistItems should be required, even if there is case that no result returned, it should return an empty array. Removed the optional.
mikekistler
left a comment
There was a problem hiding this comment.
I left a few comments for your consideration, but happy to defer to your judgement on these.
|
|
||
| @doc("The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6.") | ||
| severity: int32; | ||
| @doc("The value of this field is determined by the outputType specified in the request. If 'FourSeverityLevels' or 'EightSeverityLevels' is chosen, this field will be included in the output. The value increases with the severity of the input content.") |
There was a problem hiding this comment.
I think it would better to describe the meaning of this field first, then describe how it is affected by outputType..
| @doc("The value of this field is determined by the outputType specified in the request. If 'FourSeverityLevels' or 'EightSeverityLevels' is chosen, this field will be included in the output. The value increases with the severity of the input content.") | |
| @doc("The value increases with the severity of the input content. The value of this field is determined by the outputType specified in the request. If 'FourSeverityLevels' or 'EightSeverityLevels' is chosen, this field will be included in the output.") |
There was a problem hiding this comment.
Make sense! Fixed according to your suggestion.
|
|
||
| @doc("The higher the severity of input content, the larger this value, currently its value could be: 0,2,4,6.") | ||
| severity: int32; | ||
| @doc("The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7. The value increases with the severity of the input content.") |
There was a problem hiding this comment.
Same comment as above.
| @doc("The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7. The value increases with the severity of the input content.") | |
| @doc("The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7.") |
There was a problem hiding this comment.
Make sense! Fixed according to your suggestion.
| @doc("The type of text analysis output.") | ||
| enum AnalyzeTextOutputType { |
There was a problem hiding this comment.
I'm slightly uncomfortable in calling this "outputType", as it affects only one aspect of the output -- the severity score. Would "AnalyzeTextSeverityType" be more descriptive?
There was a problem hiding this comment.
If there is other kind of score (for example float type score in [0,1], which is not severity levels), we will reuse this field and set proper value.
And since renaming this field would be a breaking change to our current status, I would keep it no change.
Swagger Validation Report
|
| Rule | Message |
|---|---|
OBJECT_MISSING_REQUIRED_PROPERTY |
Missing required property: blocklistItemId Url: ContentSafety/stable/2023-10-01/contentsafety.json#L962:26 ExampleUrl: stable/2023-10-01/examples/AddOrUpdateBlocklistItems.json#L7:13 |
OBJECT_MISSING_REQUIRED_PROPERTY |
Missing required property: blocklistItemId Url: ContentSafety/stable/2023-10-01/contentsafety.json#L962:26 ExampleUrl: stable/2023-10-01/examples/AddOrUpdateBlocklistItems.json#L7:13 |
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️⌛PoliCheck pending [Detail]
️️✔️PrettierCheck succeeded [Detail] [Expand]
Validation passes for PrettierCheck.
️🔄SpellCheck inProgress [Detail]
️🔄Lint(RPaaS) inProgress [Detail]
️⌛PR Summary pending [Detail]
️️✔️Automated merging requirements met succeeded [Detail] [Expand]
Swagger Generation Artifacts
|
|
I will suppress the LintDiff, as it is about name of operationId; the ModelValidation, as it is a false alert on both "required" and "readonly" property (that not valid in Swagger). |
|
Swagger pipeline restarted successfully, please wait for status update in this comment. |
Data Plane API - Pull Request
API Info: The Basics
Most of the information about your service should be captured in the issue that serves as your API Spec engagement record.
Is this review for (select one):
Change Scope
This section will help us focus on the specific parts of your API that are new or have been modified.
Please share a link to the design document for the new APIs, a link to the previous API Spec document (if applicable), and the root paths that have been updated.
Viewing API changes
For convenient view of the API changes made by this PR, refer to the URLs provided in the table
in the
Generated ApiViewcomment added to this PR. You can use ApiView to show API versions diff.Suppressing failures
If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the
Swagger-Suppression-Process
to get approval.
❔Got questions? Need additional info?? We are here to help!
Contact us!
The Azure API Review Board is dedicated to helping you create amazing APIs. You can read about our mission and learn more about our process on our wiki.
Click here for links to tools, specs, guidelines & other good stuff
Tooling
Guidelines & Specifications
Helpful Links
fix azure-sdk/TestingForEngagementExperience#298