nautobot icon indicating copy to clipboard operation
nautobot copied to clipboard

Code changes needed to update to drf-spectacular latest version

Open glennmatthews opened this issue 1 year ago • 1 comments

Environment

  • Nautobot version (Docker tag too if applicable): 2.2.0

Steps to Reproduce

  1. poetry add --extras sidecar drf-spectacular~0.27.2
  2. Build container
  3. invoke check-schema

Expected Behavior

Schema generation to pass without errors

Observed Behavior

Warning: enum naming encountered a non-optimally resolvable collision for fields named "type". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Type6adEnum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "type". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Type09dEnum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "type". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "TypeF53Enum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "type". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Type7b8Enum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "type". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Type459Enum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "mode". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Mode308Enum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.
Warning: enum naming encountered a non-optimally resolvable collision for fields named "mode". The same name has been used for multiple choice sets in multiple components. The collision was resolved with "Mode791Enum". add an entry to ENUM_NAME_OVERRIDES to fix the naming.

Schema generation summary:
Warnings: 7 (7 unique)
Errors:   0 (0 unique)

SchemaGenerationError: Failing as requested due to warnings

This appears to be due to additional validation logic added by https://github.com/tfranzel/drf-spectacular/pull/1113

glennmatthews avatar Apr 01 '24 18:04 glennmatthews

Once this is done, ensure the dependency is actually updated.

lampwins avatar Apr 04 '24 18:04 lampwins