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

[Hub Generated] Review request for Microsoft.ApiManagement to add version stable/2019-01-01 #5824

Merged
merged 3 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "./definitions.json#/definitions/SchemaContract"
"$ref": "./definitions.json#/definitions/SchemaCreateOrUpdateContract"
Copy link
Contributor

Choose a reason for hiding this comment

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

Updating the name here may cause a breaking change in the SDKs since the name of the type representing this definition is changing. Do you need to update this one? or should the update to "document" property be happening in the SchemaContract definition?

Copy link
Member Author

Choose a reason for hiding this comment

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

For CRUD on Schema, the CreateOrUpdate contract different from the response SchemaContract
for CreateOrUpdate the contract requires properties.document.value but the response is properties.document
In existing clients this scenario was broken, hence we need to split the contract, otherwise, when the resource is created client cannot serialize the document in the response

Copy link
Member Author

Choose a reason for hiding this comment

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

we can make document as jobject, but it will degrade the experience when writing clients. Since the scenario anyway was not working, I think creating a good client experience is fine.

},
"description": "The schema contents to apply."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4209,6 +4209,21 @@
},
"description": "The response of the list schema operation."
},
"SchemaCreateOrUpdateContract": {
"properties": {
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/SchemaCreateOrUpdateProperties",
"description": "Properties of the Schema."
}
},
"allOf": [
{
"$ref": "./apimanagement.json#/definitions/Resource"
}
],
"description": "Schema Contract details."
},
"SchemaContract": {
"properties": {
"properties": {
Expand All @@ -4228,11 +4243,10 @@
"properties": {
"contentType": {
"type": "string",
"description": "Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml)."
"description": "Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. "
},
"document": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/SchemaDocumentProperties",
"type": "object",
"description": "Properties of the Schema Document."
}
},
Expand All @@ -4241,6 +4255,23 @@
],
"description": "Schema contract Properties."
},
"SchemaCreateOrUpdateProperties": {
"properties": {
"contentType": {
"type": "string",
"description": "Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`."
},
"document": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/SchemaDocumentProperties",
"description": "Create or update Properties of the Schema Document."
}
},
"required": [
"contentType"
],
"description": "API Schema create or update contract Properties."
},
"SchemaDocumentProperties": {
"properties": {
"value": {
Expand Down