📝 Improve `re_path` default parameter schema (#1439)
Currently we default to
str as schema for all patterns in re_path. However, this is not the only thing we can do. We can also copy the pattern itself to the schema. Example:re_path(r'^v(?P<version>\d+)/$', VersionController.as_view()) # schema: {type: string}
We can copy the pattern as well:
# re_path (?P<version>\d+)
- name: version
in: path
schema: {type: string, pattern: '^\d+$'}
This way users would have more info about what is expected.
See
django-modern-rest/dmr/openapi/generators/component_parsers.py
Lines 136 to 152 in 87a02f5
for current schema generation.
#feature #good_first_issue #help_wanted #openapi #opensource_september #django_modern_rest
sent via relator