Issue #9056
closedruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum
Description
After upgrading ot 3.13.3 of the pulp_rpm_client, the ruby bindings started throwing an error:
uninitialized constant PulpRpmClient::OneOfMetadataChecksumTypeEnumNullEnum (NameError)
looking at the code, there are references to OneOfMetadataChecksumTypeEnumNullEnum but the class isn't defined anywhere. I dug into the python client code and it appears it may be the same case for it too.
I see other enums defined properly
We've got a workaround for now , but would like this fixed going forward.
Related issues
Updated by dkliban@redhat.com over 3 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 100
Updated by ipanova@redhat.com over 3 years ago
- Sprint changed from Sprint 101 to Sprint 102
Updated by fao89 over 3 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to fao89
Updated by fao89 over 3 years ago
The issue happens with fields with choices that are nullable
metadata_checksum_type = models.CharField(null=True, choices=CHECKSUM_CHOICES, max_length=10)
package_checksum_type = models.CharField(null=True, choices=CHECKSUM_CHOICES, max_length=10)
drf_spectacular uses oneOf to distinguish the options null/choice
"metadata_checksum_type": {
"nullable": true,
"description": "The checksum type for metadata.",
"oneOf": [
{
"$ref": "#/components/schemas/MetadataChecksumTypeEnum"
},
{
"$ref": "#/components/schemas/NullEnum"
}
]
},
"package_checksum_type": {
"nullable": true,
"description": "The checksum type for packages.",
"oneOf": [
{
"$ref": "#/components/schemas/PackageChecksumTypeEnum"
},
{
"$ref": "#/components/schemas/NullEnum"
}
]
},
pulp-openapi-generator creates these models:
MetadataChecksumTypeEnum, PackageChecksumTypeEnum and NullEnum
The issue happens when declaring the types:
openapi_types = {
'pulp_labels': 'object',
'name': 'str',
'description': 'str',
'retain_repo_versions': 'int',
'remote': 'str',
'autopublish': 'bool',
'metadata_signing_service': 'str',
'retain_package_versions': 'int',
'metadata_checksum_type': 'OneOfMetadataChecksumTypeEnumNullEnum',
'package_checksum_type': 'OneOfPackageChecksumTypeEnumNullEnum',
'gpgcheck': 'int',
'repo_gpgcheck': 'int',
'sqlite_metadata': 'bool'
}
what would be type PackageChecksumTypeEnum or NullEnum is declared as OneOfPackageChecksumTypeEnumNullEnum
Updated by pulpbot over 3 years ago
- Status changed from ASSIGNED to POST
Updated by pulpbot over 3 years ago
Updated by dalley over 3 years ago
- Copied to Backport #9265: Backport #9056 "ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum" to 3.14.z added
Added by Fabricio Aguiar over 3 years ago
Updated by Anonymous over 3 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|eab862a60094f2c38622435196c28ff800700d15.
Updated by pulpbot about 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Removing OpenAPI blank enums
closes #9056