This is to add Cognitive Services data-plane API specs starting with Face API.#1467
This is to add Cognitive Services data-plane API specs starting with Face API.#1467fearthecowboy merged 9 commits intoAzure:currentfrom
Conversation
|
@DavidLiCIG, |
|
You should have a Here's a simple # Cognitive Services Face SDK
> see https://aka.ms/autorest
Example configuration for generating Face SDK.
The current release is `release_1_0`.
``` yaml
tag: release_1_0
```
# Releases
### Release 1.0
These settings apply only when `--tag=release_1_0` is specified on the command line.
``` yaml $(tag) == 'release_1_0'
input-file: v1.0/Face.json
```
## CSharp Settings
These settings apply only when `--csharp` is specified on the command line.
``` yaml $(csharp)
csharp:
namespace: Azure.CognitiveServices.Face
```
## NodeJS Settings
These settings apply only when `--csharp` is specified on the command line.
``` yaml $(nodejs)
nodejs:
namespace: Azure.CognitiveServices.Face
``` |
fearthecowboy
left a comment
There was a problem hiding this comment.
A few glitches in this document -- if you could fix them and update, that'd be great.
(I'll keep reviewing)
| "VerifyResponse": { | ||
| "type": "object", | ||
| "required": [ | ||
| "isIdentifical" |
There was a problem hiding this comment.
You meant isIdentical not isIdentifical ?
| "CreatePersonResponse": { | ||
| "type": "object", | ||
| "required": [ | ||
| "name" |
There was a problem hiding this comment.
You have required property name and no name property.
| "GetPersonFaceResponse": { | ||
| "type": "object", | ||
| "required": [ | ||
| "persistedFacedId" |
There was a problem hiding this comment.
You meant persistedFaceId not persistedFacedId ?
| }, | ||
| "faceLandmarks": { | ||
| "pupilLeft": { | ||
| "x": 412.7, |
There was a problem hiding this comment.
Note that you have a type mismatch here!
All these properties are modeled to have type Position which (see below) has integer x and y. Either the example or the model is wrong, please adjust one accordingly. (Maybe you have two types of "Position", one with integer coordinates and one without?)
|
|
||
| ``` | ||
| ## NodeJS Settings | ||
|
|
There was a problem hiding this comment.
please remove this config :) we don't use namespaces in our nodejs sdks and the setting's description also says it will be applied for --csharp :)
There was a problem hiding this comment.
Ah, sorry -- that was my fault. I pasted the sample that I was working with locally..
@DavidLiCIG -- I removed the nodejs section and pushed it to your branch.
There was a problem hiding this comment.
also -- @balajikris -- This is a data-plane SDK -- do you currently publish other data-plane SDKs for nodejs yet?
There was a problem hiding this comment.
@fearthecowboy -- yes, batch, keyvault, monitor, datalake are few services that come to mind.
|
Hi @DavidLiCIG Are there any updates here? |
|
Hi: I have updated the spec based on feedback. The CI is failing because the "File" type is not understood, but that's a feature gap for the CI validation I believe. @olydis Thanks, |
|
I'm working on finishing the review right now. |
fearthecowboy
left a comment
There was a problem hiding this comment.
Hey @DavidLiCIG
You get the pleasure of being one of the first data-plane APIs that we're working with, so we're in some uncharted waters here, but this is really going to help us make sure that we've got the support for things we need to help make these SDKs great.
I'm trying to balance some of the conceptual things we've used for ARM resources as well as making sure that the generated API would be usable.
I've given feedback in a few places but the patterns are all throughout the document.
If you'd like we could meet and I we could go over some of this interactively, and we could come up with some patterns that would make a much better SDK experience.
| { | ||
| "name": "start", | ||
| "in": "query", | ||
| "description": "List person groups from the least personGroupId greater than the \"start\". It contains no more than 64 characters. Default is empty. ", |
There was a problem hiding this comment.
You've got a lot of text like Default is empty. in description fields. This is really not a good practice, as the description gets translated into doc comments in many languages and how each language supports default values can be different, plus it is creating a textual dependency between the description and the implementation ( ie, if the default changes in a later release, the text and the default flags have to be changed, and this is a real PITA later.
| "in": "query", | ||
| "description": "The number of person groups to list, ranging in [1, 1000]. Default is 1000. ", | ||
| "type": "integer", | ||
| "default": "1000", |
There was a problem hiding this comment.
This should not have an enum -- that's used for single values. you can put a range in place with
"minimum": 1,
"maximum": 1000,| { | ||
| "name": "top", | ||
| "in": "query", | ||
| "description": "The number of person groups to list, ranging in [1, 1000]. Default is 1000. ", |
There was a problem hiding this comment.
please don't specify default is ... (see above)
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "A successful call returns an array of person groups and their information (personGroupId, name and userData).", |
There was a problem hiding this comment.
You probably don't want to specify details like (personGroupId, name and userData) -- the class definitions should do that nicely.
| "/persongroups/{personGroupId}/train": { | ||
| "post": { | ||
| "description": "Queue a person group training task, the training task may not be started immediately.", | ||
| "operationId": "PersonGroups_Train", |
There was a problem hiding this comment.
I'm curious about your operationIds.
The generator will group the methods into classes based on what's in front of the underscore, and method names from what is after.
The classes I see getting generated are
Faces
PersonGroups
Persons
FaceListsAre these the names of the classes that you'd like to see?
Some code would look like:
var api = new FaceAPI ();
IList<DetectResponseElement> results = api.Faces.DetectAsync( ... ) Is Faces the right word there? Maybe Face?
And the result type is DetectResponseElement .. and you get an IList<> of those. -- could we find a better word like Detection (or something that describes a purpose rather than some Element
(If I'm way off base here, we can discuss it more ...)
| ] | ||
| }, | ||
| "get": { | ||
| "description": "Retrieve a face list's information, including faceListId, name, userData and faces in the face list. ", |
There was a problem hiding this comment.
Again, don't bother mentioning property names.
| "properties": { | ||
| "faceId": { | ||
| "type": "string", | ||
| "description": "FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call" |
There was a problem hiding this comment.
In the description User needs to call Face - Detect first to get a valid faceId. you say Face - Detect , but the operationId is Faces_Detect -- which generates a Faces class and the method Detect is implemented in several ways.
We should probably make sure this is clear and consistent. Saying Detect is probably fine, but the Face- part is not such a good idea
| "required": [ | ||
| "faceId" | ||
| ], | ||
| "description": "", |
There was a problem hiding this comment.
Even though you've specified this should be flattened, the description should never be empty. Some languages may not work the same.
| "type": "object", | ||
| "description": "", | ||
| "properties": { | ||
| "anger": { |
There was a problem hiding this comment.
all missing description fields
| "$ref": "#/definitions/FindSimilarResponseElement" | ||
| } | ||
| }, | ||
| "FindSimilarResponseElement": { |
There was a problem hiding this comment.
I'd avoid Response in class names, as they affect generation and don't give a good experience.
|
Hi @DavidLiCIG Can we get some updates on your progress on this PR :) |
|
@salameer -- we just synced up in person yesterday ... he's on it! |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
@salameer @fearthecowboy Hi, yep, just worked through and cleaned it up quite a bit. |
| } | ||
| }, | ||
| "x-ms-paths": { | ||
| "/detect?overload=url": { |
There was a problem hiding this comment.
Quick Question -- does the service expect the overload=url parameter to actually be sent? or does it infer the operation from the post contents?
| @@ -0,0 +1,2 @@ | |||
| out/** | |||
There was a problem hiding this comment.
hmm. don't include local .gitignore files in the PR. You can keep them local, but we really don't need them in the master repo.
fearthecowboy
left a comment
There was a problem hiding this comment.
Just a couple minor things -- drop the .gitignore file, and a question.
After that, I can approve immediately.
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: File: AutoRest Linter Guidelines | AutoRest Linter Issues Send feedback and make AutoRest Linter Azure Bot smarter day by day! Thanks for your co-operation. |
|
I'm merging this -- the CI is falsely claiming that there isn't a type 'file' (we're not publishing SDKs quite yet anyway :D) |
|
No modification for AutorestCI/azure-sdk-for-python |
|
No modification for AutorestCI/azure-sdk-for-node |
|
No modification for AutorestCI/azure-sdk-for-ruby |
…d balancer (#1528) * Updating documentation for Microsoft.VisualStudio with project resource APIs. Corrections to existing examples. (#1498) * Added Api-Version 2017-07-01 for RecoveryServices.Backup Jobs (#1502) * Added Api-Version 2017-07-01 for RecoveryServices.Backup Jobs * Updated tag names * Microsoft.Sql - Added data sync to package-2015-05-preview (#1510) * Added advisors and data sync to package-2015-05-preview * Removed advisors so current branch is only data sync * Make MsDeploy and MsDeployLog Azure resources (#1519) * Add public certificates, Functions Admin Token and MSDeploy APIs * Revert resource definition changes and description change for site properties * Make type and name readonly properties. Add ARM envelope to MSDeployStatus object * Fix missing quotation issue. * Add long running operation to MS deploy * Make MsDeploy and MsDeployLog Azure resources * Fix some AutoRest validation issues. Use dictionary for msdeploy.setparameters * Ensure models are same across all schemas in Microsoft.Web * Fix azure resource type across all models * Remove conflicting ListOperations. It is not used for public Azure. * no YAML in glob patterns for report scripts * Copying 2017-06-01 to 2017-08-01 * Changes for new API version * Updated script to run autorest with grouping swaggers based on config file (#1529) * Removed the maxLength for entities (#1527) * Update folder structure example. (#1489) Agreed on the changes * [Travis-ci] Oad in ci status (#1520) * Breaking change build should fail if result contains error Skipping newly added files Incorporating review feedback * testing * log the result as oad.compare returns promise for caller * Use published oad * Revert "testing" This reverts commit a9be94d. * Removed maxLength from entity name (#1531) * This is to add Cognitive Services data-plane API specs starting with Face API. (#1467) * Adding data plane spec starting with Face * Move Spec to right folder * Fixing validation issues. * Fixing issues and adding a readme.md * Fixing examples by removing decimals. * Removing another decimal value * Update readme.md * Updating spec based on comments. * Removing .gitignore. * Relay: Removed the maxLength for entity names (#1535)
…d balancer (#1528) (#1543) * Updating documentation for Microsoft.VisualStudio with project resource APIs. Corrections to existing examples. (#1498) * Added Api-Version 2017-07-01 for RecoveryServices.Backup Jobs (#1502) * Added Api-Version 2017-07-01 for RecoveryServices.Backup Jobs * Updated tag names * Microsoft.Sql - Added data sync to package-2015-05-preview (#1510) * Added advisors and data sync to package-2015-05-preview * Removed advisors so current branch is only data sync * Make MsDeploy and MsDeployLog Azure resources (#1519) * Add public certificates, Functions Admin Token and MSDeploy APIs * Revert resource definition changes and description change for site properties * Make type and name readonly properties. Add ARM envelope to MSDeployStatus object * Fix missing quotation issue. * Add long running operation to MS deploy * Make MsDeploy and MsDeployLog Azure resources * Fix some AutoRest validation issues. Use dictionary for msdeploy.setparameters * Ensure models are same across all schemas in Microsoft.Web * Fix azure resource type across all models * Remove conflicting ListOperations. It is not used for public Azure. * no YAML in glob patterns for report scripts * Copying 2017-06-01 to 2017-08-01 * Changes for new API version * Updated script to run autorest with grouping swaggers based on config file (#1529) * Removed the maxLength for entities (#1527) * Update folder structure example. (#1489) Agreed on the changes * [Travis-ci] Oad in ci status (#1520) * Breaking change build should fail if result contains error Skipping newly added files Incorporating review feedback * testing * log the result as oad.compare returns promise for caller * Use published oad * Revert "testing" This reverts commit a9be94d. * Removed maxLength from entity name (#1531) * This is to add Cognitive Services data-plane API specs starting with Face API. (#1467) * Adding data plane spec starting with Face * Move Spec to right folder * Fixing validation issues. * Fixing issues and adding a readme.md * Fixing examples by removing decimals. * Removing another decimal value * Update readme.md * Updating spec based on comments. * Removing .gitignore. * Relay: Removed the maxLength for entity names (#1535)
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-versionin the path should match theapi-versionin the spec).Quality of Swagger