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

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

merged 1 commit into from
Oct 14, 2016


Copy link

@ikawaha 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)

Copy link

tchssk commented Oct 14, 2016

Oh I forgot to fix gen_swagger in #507😅

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
@ikawaha ikawaha deleted the fix/gen_swagger/optional_payload branch October 15, 2016 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants