Skip to content
Closed
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
31 changes: 26 additions & 5 deletions specs/latest/open-api3-latest-console.json
Original file line number Diff line number Diff line change
Expand Up @@ -66367,7 +66367,14 @@
{
"$ref": "#\/components\/schemas\/providerRepositoryFrameworkList"
}
]
],
"discriminator": {
"propertyName": "type",
"mapping": {
"runtime": "#\/components\/schemas\/providerRepositoryRuntimeList",
"framework": "#\/components\/schemas\/providerRepositoryFrameworkList"
}
}
}
}
}
Expand Down Expand Up @@ -71417,15 +71424,22 @@
"$ref": "#\/components\/schemas\/providerRepositoryFramework"
},
"x-example": ""
},
"type": {
"type": "string",
"description": "Provider repository list type.",
"x-example": "framework"
}
Comment on lines +71428 to 71432
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missing enum constraint on discriminator property

The type field is used as the discriminator property but is declared as an unconstrained string. Each schema should restrict the discriminator to exactly the value it represents so validators and code generators can enforce the mapping. The same applies to providerRepositoryRuntimeList.type.

Suggested change
"type": {
"type": "string",
"description": "Provider repository list type.",
"x-example": "framework"
}
"type": {
"type": "string",
"description": "Provider repository list type.",
"enum": ["framework"],
"x-example": "framework"
}

},
"required": [
"total",
"frameworkProviderRepositories"
"frameworkProviderRepositories",
"type"
],
"example": {
"total": 5,
"frameworkProviderRepositories": ""
"frameworkProviderRepositories": "",
"type": "framework"
}
},
"providerRepositoryRuntimeList": {
Expand All @@ -71445,15 +71459,22 @@
"$ref": "#\/components\/schemas\/providerRepositoryRuntime"
},
"x-example": ""
},
"type": {
"type": "string",
"description": "Provider repository list type.",
"x-example": "runtime"
}
},
"required": [
"total",
"runtimeProviderRepositories"
"runtimeProviderRepositories",
"type"
],
"example": {
"total": 5,
"runtimeProviderRepositories": ""
"runtimeProviderRepositories": "",
"type": "runtime"
}
},
"branchList": {
Expand Down
31 changes: 26 additions & 5 deletions specs/latest/swagger2-latest-console.json
Original file line number Diff line number Diff line change
Expand Up @@ -66180,7 +66180,14 @@
{
"$ref": "#\/definitions\/providerRepositoryFrameworkList"
}
]
],
"x-discriminator": {
"propertyName": "type",
"mapping": {
"runtime": "#\/definitions\/providerRepositoryRuntimeList",
"framework": "#\/definitions\/providerRepositoryFrameworkList"
}
}
}
}
},
Expand Down Expand Up @@ -71123,15 +71130,22 @@
"$ref": "#\/definitions\/providerRepositoryFramework"
},
"x-example": ""
},
"type": {
"type": "string",
"description": "Provider repository list type.",
"x-example": "framework"
}
},
"required": [
"total",
"frameworkProviderRepositories"
"frameworkProviderRepositories",
"type"
],
"example": {
"total": 5,
"frameworkProviderRepositories": ""
"frameworkProviderRepositories": "",
"type": "framework"
}
},
"providerRepositoryRuntimeList": {
Expand All @@ -71152,15 +71166,22 @@
"$ref": "#\/definitions\/providerRepositoryRuntime"
},
"x-example": ""
},
"type": {
"type": "string",
"description": "Provider repository list type.",
"x-example": "runtime"
}
},
"required": [
"total",
"runtimeProviderRepositories"
"runtimeProviderRepositories",
"type"
],
"example": {
"total": 5,
"runtimeProviderRepositories": ""
"runtimeProviderRepositories": "",
"type": "runtime"
}
},
"branchList": {
Expand Down
Loading