Skip to content
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

Added new specification for chat - release 2020-11-01-preview3 #11716

Merged
merged 10 commits into from
Dec 16, 2020

Conversation

juancamilor
Copy link
Member

Added latest API for chat.

  • Examples
  • Swagger
  • Readme

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Nov 18, 2020

Swagger Validation Report

️️✔️BreakingChange succeeded [Detail] [Expand]
There are no breaking changes.
️⚠️LintDiff: 12 Warnings warning [Detail] Only 10 items are listed, please refer to log for more details.

Rule Message
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L477
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L398
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L170
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L245
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L328
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L988
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L96
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L546
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L608
⚠️ R2063 - OperationIdNounConflictingModelNames OperationId has a noun that conflicts with one of the model names in definitions section. The model name will be disambiguated to 'ChatThreadModel'. Consider using the plural form of 'ChatThread' to avoid this. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
New: Microsoft.CommunicationServicesChat/preview/2020-11-01-preview3/communicationserviceschat.json#L689
️️✔️Avocado succeeded [Detail] [Expand]
Validation passes for Avocado.
️️✔️ModelValidation succeeded [Detail] [Expand]
Validation passes for ModelValidation.
️️✔️SemanticValidation succeeded [Detail] [Expand]
Validation passes for SemanticValidation.
️️✔️[Staging] Cross Version BreakingChange (Base on preview version) succeeded [Detail] [Expand]
There are no breaking changes.
️️✔️[Staging] Cross Version BreakingChange (Base on stable version) succeeded [Detail] [Expand]
There are no breaking changes.
Posted by Swagger Pipeline | How to fix these errors?

@openapi-pipeline-app
Copy link

openapi-pipeline-app bot commented Nov 18, 2020

Swagger Generation Artifacts

️🔄 $(sdkName) inProgress [Detail]
️🔄[Staging] ApiDocPreview inProgress [Detail]
Posted by Swagger Pipeline | How to fix these errors?

@RezaJooyandeh
Copy link
Member

I see some build issues. You probably need to update the cSpell file and run prettier.

@amrElroumy
Copy link
Contributor

I see some build issues. You probably need to update the cSpell file and run prettier.

@RezaJooyandeh It is complaining about readreceipts in this route /chat/threads/{chatThreadId}/readreceipts

This seems to be a new check, should we sluggify compound words? i.e. readreceipts => read-receipts, with the final route being /chat/threads/{chatThreadId}/read-receipts

@RezaJooyandeh
Copy link
Member

@amrElroumy good point. The recommendation is to use camelCase so maybe that actually solve the problem

"Threads"
],
"summary": "Creates a chat thread.",
"operationId": "CreateChatThread",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good that we have added "Chat" to the types (eg. ChatMessage, ChatThread, etc.), but for the method names, it becomes redundant: ChatClient.CreateChatThread. I think we should remove the duplicated "Chat" from the operation ids so we would have ChatClient.CreateThread

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was discussed during private preview (for the method names included), and 3 of the architects were strong about adding Chat, so the decision was to with the prefix across the board. Their argument was that CreateThread or GetThread was too generic and Thread had a strong connotation in software.
Also just to be clear, the 'public' methods on the Clients are not driven by the swagger. They are all hand crafted.

],
"responses": {
"200": {
"description": "Request successful. The action returns a `Thread` resource.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should remove "`" from the description as it is not necessarily going to be used in a markup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this. I just noticed there are few more with the "`" as well

"description": "A chat message read receipt indicates the time a chat message was read by a recipient.",
"type": "object",
"properties": {
"senderId": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DominikMe we should standardized the format for identifiers in REST APIs based on what we talked about to make sure all our services are consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should use the common CommunicationIdentifier type instead of string.

}
}
},
"ChatMessagePriority": {
Copy link
Member

@RezaJooyandeh RezaJooyandeh Nov 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning to remove this in a separate iteration? I talked to @ashwinder during public preview release, but it was too last-minute of a change. We agreed to hide this and when we have a more generalized approach bring it back (not necessarily, but maybe something like a property bag that developers can add key-values). "Priority" by itself is too specific to be a property and does not scale. Let's make sure we do it before we get to close to finalization

Copy link
Member Author

@juancamilor juancamilor Nov 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a feature we have not started yet for tagging which will have something like that.
I have seen 'Priority' in other vendors though, so not sure how expected could be to have an explicit priority. Good to loop some product folks ..

"example": "123456789"
},
"type": {
"description": "Type of the chat message.\r\n \r\nPossible values:\r\n - Text\r\n - ThreadActivity/TopicUpdate\r\n - ThreadActivity/AddMember\r\n - ThreadActivity/DeleteMember",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably remove "\r" and "\n"s from here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an unordered list that looks like this:

Type of the chat message.

Possible values:
- Text
- ThreadActivity/TopicUpdate
- ThreadActivity/AddMember
- ThreadActivity/DeleteMember

Wouldn't removing the new lines, make it hard to grok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it should become an extensible enum?

"readOnly": true,
"example": "123456789"
},
"type": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also talk about potentially removing the thread activities from here. We should not really return the xml responses. Specially if they are being delivered through eventgrid and real time channel

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a feature on its own. I initially thought also a message should be just a message (always), but after hearing some of the requirements from other P1 clients (dynamics / rave), for them a message includes all types (system level messages, text user messages, etc..), so we probably want to account for those before going ahead.
There is also this underlying issue with pagination, so if we go with a separate end point, I think the right way of doing is is asking MFE to implement it, so we just expose it.

@DominikMe
Copy link
Member

I see some build issues. You probably need to update the cSpell file and run prettier.

@RezaJooyandeh Reza Jooyandeh FTE It is complaining about readreceipts in this route /chat/threads/{chatThreadId}/readreceipts

This seems to be a new check, should we sluggify compound words? i.e. readreceipts => read-receipts, with the final route being /chat/threads/{chatThreadId}/read-receipts

@amrElroumy The guidance is to use lowerCamelCase everywhere, so readReceipts would be correct.

},
{
"in": "query",
"name": "maxPageSize",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guidelines name it differently, $maxpagesize

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

"CreateChatThreadResult": {
"type": "object",
"properties": {
"chatThread": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"description": "The thread created."
If we don't add descriptions, the sdks side complains with warnings.

Same for errors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is odd, the type already has xml documentation there.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed now, the description is under the "ChatThread" definition.

Copy link
Member

@CHILIU-MSFT CHILIU-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments around common definitions and property flags.

"401": {
"description": "Unauthorized.",
"schema": {
"$ref": "#/definitions/Error"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should reference the Error definition from the common.json that we checked in.

},
"x-ms-pageable": {
"nextLinkName": "nextLink",
"itemName": "value"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi this is not needed as value is the default. but doesn't hurt

"description": "A chat message read receipt indicates the time a chat message was read by a recipient.",
"type": "object",
"properties": {
"senderId": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should use the common CommunicationIdentifier type instead of string.

"readOnly": true,
"example": "2020-10-30T10:50:50Z"
},
"senderId": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be the common CommunicationIdentifier type

"items": {
"$ref": "#/definitions/ChatMessage"
},
"readOnly": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of readOnly we should mark properties add properties to required. Otherwise AutoREST generates poorly usable code. Properties that are not required, can then be marked readonly where applicable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value for example should be required here

"description": "The participants that failed to be added to the chat thread.",
"type": "array",
"items": {
"$ref": "#/definitions/Error"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use common error shape

"ChatThread": {
"description": "Chat thread.",
"type": "object",
"properties": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything that's readonly here should be required instead.

"readOnly": true,
"example": "19:uni01_uy5ucb66ugp3lrhe7pxso6xx4hsmm3dl6eyjfefv2n6x3rrurpea@thread.v2"
},
"topic": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also do a pass and mark everything as x-nullable: false where applicable

Copy link
Member

@DominikMe DominikMe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving now to merge and iterate.

Let's reference this PR in a follow up to carry over and address remaining comments.

@juancamilor
Copy link
Member Author

@DominikMe you need to hit merge too :(

@juancamilor
Copy link
Member Author

@tjprescott Travis, could you give us a hand merging this one ? Apparently all the folks with permissions are on vacations, and this is an incremental merge so we will need to do it few more times in the next week or so.
FYI @DominikMe

@tjprescott tjprescott merged commit 3a3a945 into Azure:master Dec 16, 2020
@juancamilor juancamilor deleted the chat-2020-11-01-preview3 branch December 16, 2020 23:53
giromm2ms pushed a commit to giromm2ms/azure-rest-api-specs that referenced this pull request Dec 20, 2020
…#11716)

* Added new specification for chat - release 2020-11-01-preview3

* Addressing feedback

* Updating max page size parameter name

* update `maxpagesize` parameter name in example file.

* Runn prettier on examples

* Removing obsolete example files, and adding missing description properties.

* Update `maxpagesize` query parameter name for `ListChatThreads`

* rename $maxpagesize to `maxPageSize`

Co-authored-by: Camilo Ramirez <[email protected]>
Co-authored-by: Amr Elroumy <[email protected]>
josuhazure pushed a commit to josuhazure/azure-rest-api-specs that referenced this pull request Jan 6, 2021
…#11716)

* Added new specification for chat - release 2020-11-01-preview3

* Addressing feedback

* Updating max page size parameter name

* update `maxpagesize` parameter name in example file.

* Runn prettier on examples

* Removing obsolete example files, and adding missing description properties.

* Update `maxpagesize` query parameter name for `ListChatThreads`

* rename $maxpagesize to `maxPageSize`

Co-authored-by: Camilo Ramirez <[email protected]>
Co-authored-by: Amr Elroumy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants