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

Parameter to omit field from output #57

Closed
jrdnull opened this issue Jan 8, 2019 · 2 comments
Closed

Parameter to omit field from output #57

jrdnull opened this issue Jan 8, 2019 · 2 comments

Comments

@jrdnull
Copy link
Contributor

jrdnull commented Jan 8, 2019

Is there a way I can omit a field from the output, e.g:

type paginate struct {
    // Page to retrieve {required}.
    Page int

    // Number of results in a single page {range: 20-100, default: 20}.
    PageSize int

    // Sorting order {enum: asc desc} {default: asc}.
    Order int

    // Only fetch results updated since this time {date-time}.
    UpdatedSince time.Time

    Internal bool // {omit}
}

{-} or {omit} ?

I could use the json tag, json:"-" but I would like it in the json, I just don't want it appearing in the docs as its not really needed and adds a lot of extra fields.

@arp242
Copy link
Contributor

arp242 commented Jan 8, 2019

No, there is no way right now; haven't needed it yet. Should be easy to add if it's needed.

Also, dupe of: #47

@arp242 arp242 closed this as completed Jan 8, 2019
@arp242
Copy link
Contributor

arp242 commented Jan 9, 2019

Actually not exact dupe, as the other issue is about hiding parts of the docs, while this is about omitting a field completely. Either way, I made a PR: #58

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

2 participants