Project

Profile

Help

Issue #9056

closed

ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum

Added by jsherril@redhat.com over 3 years ago. Updated about 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 103
Quarter:

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

Copied to Pulp - Backport #9265: Backport #9056 "ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum" to 3.14.zCLOSED - CURRENTRELEASE

Actions
Actions #1

Updated by dkliban@redhat.com over 3 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 100
Actions #2

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 100 to Sprint 101
Actions #3

Updated by ipanova@redhat.com over 3 years ago

  • Sprint changed from Sprint 101 to Sprint 102
Actions #4

Updated by rchan over 3 years ago

  • Sprint changed from Sprint 102 to Sprint 103
Actions #5

Updated by dalley over 3 years ago

  • Priority changed from Normal to High
Actions #6

Updated by fao89 over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #7

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

Actions #8

Updated by fao89 over 3 years ago

  • Project changed from Pulp to RPM Support
Actions #9

Updated by fao89 over 3 years ago

  • Project changed from RPM Support to Pulp
Actions #10

Updated by pulpbot over 3 years ago

  • Status changed from ASSIGNED to POST
Actions #12

Updated by dalley over 3 years ago

  • Sprint/Milestone set to 3.15.0
Actions #13

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

Revision eab862a6 | View on GitHub

Removing OpenAPI blank enums

closes #9056

Actions #14

Updated by Anonymous over 3 years ago

  • Status changed from POST to MODIFIED
Actions #15

Updated by pulpbot about 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF