-
-
Notifications
You must be signed in to change notification settings - Fork 365
Description
I was wondering how to interpret the SqlConnectionInfo definition in the Azure JSON-Schema.
It looks like this:
"SqlConnectionInfo": {
"type": "object",
"oneOf": [
{
"properties": {
"type": {
"type": "string",
"enum": [
"SqlConnectionInfo"
]
}
}
}
],
"properties": {
"userName": {
"type": "string",
"description": "User name"
},
"password": {
"type": "string",
"description": "Password credential."
},
"type": {
"type": "string"
},
...
},
...
},Full JSON-Schema: https://schema.management.azure.com/schemas/2017-11-15-privatepreview/Microsoft.DataMigration.json.
Is the right way to interpret this:
SqlConnectionInfois an object which may declare keysuserName,password, andtype- If declared, the
typefield must be the string literal"SqlConnectionInfo"
Motivation: making sure that https://github.com/bcherny/json-schema-to-typescript/pull/603/files doesn't regress TypeScript typing generation for Azure's JSON-Schema.
Side note: it would be nice if the JSON-Schema Spec and docs more directly talked about how to handle complex schemas like this one, where more than one keyword applies (eg. if this schema definition moved the oneOf into type's definition, it would be much more clear how to interpret this schema). Or, let me know if I missed it in the docs.