-
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
Fix headers and schema definition #27180
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7007,8 +7007,11 @@ | |
}, | ||
"headers": { | ||
"type": "object", | ||
"x-ms-format": "dfe-key-value-pairs", | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: dictionary (or Expression with resultType dictionary)." | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: string (or Expression with resultType string).", | ||
"additionalProperties": { | ||
"type": "string", | ||
"x-ms-format": "dfe-string" | ||
} | ||
}, | ||
"body": { | ||
"type": "object", | ||
|
@@ -8045,8 +8048,11 @@ | |
}, | ||
"headers": { | ||
"type": "object", | ||
"x-ms-format": "dfe-key-value-pairs", | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: dictionary (or Expression with resultType dictionary)." | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: string (or Expression with resultType string).", | ||
"additionalProperties": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use of additionalProperties is not allowed for properties owned by the service. The only time its ok to use it is when the properties are pass thru (user defined) and not subject to any validations. Please schematize this object, make it an array or provide an explanation for why you need to use this pattern. #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The additionalProperties we've included serve as HTTP headers specified by the customer. This schema does not follow a specific pattern. Moreover, This schemaChange also fix ADF .NET SDK issues. The ADF .NET SDK has some special x-ms-format, identified by a 'dfe-' prefix, such as 'dfe-key-value-pairs'. This update in the schema also addresses an issue in the .NET Track2 SDK, where customers were unable to create web activities with headers (refer to Azure SDK for .NET Issue #39187 for more details). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the HTTP headers just passed straight through without any examination or validation applied? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. The HTTP headers just passed through. No validation. |
||
"type": "string", | ||
"x-ms-format": "dfe-string" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you use x-ms-format, then its type must be object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to our test, if we define the type as object inside the additionalProperties. For additionalProperties the generated model is |
||
} | ||
}, | ||
"body": { | ||
"type": "object", | ||
|
@@ -8111,8 +8117,11 @@ | |
}, | ||
"headers": { | ||
"type": "object", | ||
"x-ms-format": "dfe-key-value-pairs", | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: dictionary (or Expression with resultType dictionary)." | ||
"description": "Represents the headers that will be sent to the request. For example, to set the language and type on a request: \"headers\" : { \"Accept-Language\": \"en-us\", \"Content-Type\": \"application/json\" }. Type: string (or Expression with resultType string).", | ||
"additionalProperties": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
"type": "string", | ||
"x-ms-format": "dfe-string" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
} | ||
}, | ||
"body": { | ||
"type": "object", | ||
|
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.
Use of additionalProperties is not allowed for properties owned by the service. The only time its ok to use it is when the properties are pass thru (user defined) and not subject to any validations. Please schematize this object, make it an array or provide an explanation for why you need to use this pattern. #Resolved