flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

allow definition of own swagger schema for path variables.

Open InuSasha opened this issue 4 years ago • 2 comments

Using custom converters to store the '__restx_schema__' dict. The dict updates the parameter for swagger.

Tested with (and without):

class DatabaseConverter(BaseConverter):
    __restx_schema__ = {'type': 'string', 'enum': ['ProdDB','TestDB1','TestDB2']}

The result, was a dropdown menu instead of an input field.

InuSasha avatar Feb 10 '21 16:02 InuSasha

Codecov Report

Merging #279 (d7e8c04) into master (c5b37e2) will decrease coverage by 0.14%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #279      +/-   ##
==========================================
- Coverage   96.86%   96.72%   -0.15%     
==========================================
  Files          19       19              
  Lines        2712     2716       +4     
==========================================
  Hits         2627     2627              
- Misses         85       89       +4     
Impacted Files Coverage Δ
flask_restx/swagger.py 95.78% <0.00%> (-0.97%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c5b37e2...9ba3e24. Read the comment docs.

codecov[bot] avatar Feb 10 '21 16:02 codecov[bot]

few things:

  1. is there an issue associated with this change? i didn't see any discussion points around this anywhere
  2. What is the issue and what is this trying to address? What's the rationale for this change?
  3. There are no tests for this change. considering it's new functionality, for us to be able to include it, it'll need tests

I can't review this until the above three things are addressed.

j5awry avatar Feb 17 '21 17:02 j5awry