Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How can I set an example value? #139

Open
reddytocode opened this issue Jan 23, 2020 · 2 comments
Open

[Question] How can I set an example value? #139

reddytocode opened this issue Jan 23, 2020 · 2 comments
Assignees

Comments

@reddytocode
Copy link

reddytocode commented Jan 23, 2020

I'm doing an auth service

my Register endpoint looks like:

class Register(Resource):
    @swagger.operation(
        notes='Register a new User',
        responseClass=SwaggerUserModel.__name__,
        nickname='create',
        parameters=[
            {
                "name": "body",
                "description": "This should send {"name", "password"}",
                "required": True,
                "allowMultiple": False,
                "dataType": SwaggerUserModel.__name__,
                "paramType": "body",
                "exampleValue": fake_auth_register_form
            }
        ])
    def post(self):
        data = parser.parse_args()

when I get the swagger ui it only shows me the body as an empty field, but I want to get a filled value to only press the button of "Try it out!" not having an empty one

@niall-byrne
Copy link
Collaborator

I'd like to find out if we aren't meeting the spec here, did you have any luck with this?

@qtvspa
Copy link

qtvspa commented Jun 23, 2020

try replace "exampleValue" to "defaultValue", it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants