Skip to content
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
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"
}
},
"required": [
"total",
"frameworkProviderRepositories"
"frameworkProviderRepositories",
Comment on lines 71432 to +71436
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 on discriminator property

The type field in both providerRepositoryFrameworkList and providerRepositoryRuntimeList is declared as a plain string with no enum constraint. Since the discriminator.mapping relies on exactly "framework" and "runtime" as the valid values, a schema validator will accept any arbitrary string for type (e.g. "type": "foo") without error — defeating the intent of the discriminator. Adding enum makes the contract explicit and enables correct validation:

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

The same applies to providerRepositoryRuntimeList ("enum": ["runtime"]).

"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",
Comment on lines 71138 to +71142
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 on discriminator property (Swagger 2)

Same issue as in the OpenAPI 3 spec: type in both providerRepositoryFrameworkList and providerRepositoryRuntimeList accepts any string, while the x-discriminator mapping only intends "framework" and "runtime" as valid values. Adding "enum": ["framework"] / "enum": ["runtime"] would make the constraints machine-readable and consistent with the discriminator mapping.

"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