-
Notifications
You must be signed in to change notification settings - Fork 26
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
Handle x-ms-mutability swagger extension #436
Conversation
Codecov Report
@@ Coverage Diff @@
## main #436 +/- ##
=======================================
Coverage 95.23% 95.23%
=======================================
Files 17 17
Lines 252 252
=======================================
Hits 240 240
Misses 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -294,13 +294,37 @@ export function generateTypes(host: Host, definition: ProviderDefinition) { | |||
return factory.lookupBuiltInType(BuiltInTypeKind.Any); | |||
} | |||
|
|||
function getMutabilityFlags(property: Property | undefined) { | |||
const mutability = property?.extensions?.["x-ms-mutability"] as string[]; |
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.
I think you also need to handle x-ms-secret: true
and format: password
cases. I sent you an IM about how we're dealing with that in an internal repo that is partially applicable.
If something is considered secret, we should assume write only and it should take precedence over whatever x-ms-mutability settings in the swagger.
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.
I've raised #437 to track this separately as this PR is just to fix a specific scenario. I feel like the handling of x-ms-secret
in types needs a bit more discussion.
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.
Sounds good.
Closes #240