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

Fix a bug that the payload is always required 'true' in swagger documents. #825

merged 1 commit into from Oct 14, 2016


None yet
3 participants
Copy link

ikawaha commented Oct 14, 2016

    if action.Payload != nil {
        payloadSchema := genschema.TypeSchema(api, action.Payload)
        pp := &Parameter{
            Name:        "payload",
            In:          "body",
            Description: action.Payload.Description,
            Required:    true,            // ←★ always true even if optional payloads be used.
            Schema:      payloadSchema,
        params = append(params, pp)

This comment has been minimized.

Copy link

tchssk commented Oct 14, 2016

Oh I forgot to fix gen_swagger in #507😅


This comment has been minimized.

Copy link

raphael commented Oct 14, 2016

Looks great, thank you! Do you think you could also make a PR to the v1 branch? thanks!

@raphael raphael merged commit 272b900 into goadesign:master Oct 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@ikawaha ikawaha deleted the ikawaha:fix/gen_swagger/optional_payload branch Oct 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment