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

Allow struct fields to be annotated with swagger:ignore #1527

Merged
merged 1 commit into from May 13, 2018

Conversation

neilgarb
Copy link
Contributor

Sometimes it's useful to includ a field in a request or response but leave it
undocumented. This change allows such struct fields to be annotated with
swagger:ignore, e.g.

type Foo struct {
  // swagger:ignore
  Bar string `json:"bar"`
}

See #1497.

Signed-off-by: Neil Garb neil@luno.com

Sometimes it's useful to includ a field in a request or response but leave it
undocumented. This change allows such struct fields to be annotated with
`swagger:ignore`, e.g.

```go
type Foo struct {
  // swagger:ignore
  Bar string `json:"bar"`
}
```

See go-swagger#1497.

Signed-off-by: Neil Garb <neil@luno.com>
@codecov
Copy link

codecov bot commented May 13, 2018

Codecov Report

Merging #1527 into master will increase coverage by 0.02%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1527      +/-   ##
==========================================
+ Coverage   74.21%   74.24%   +0.02%     
==========================================
  Files          37       37              
  Lines        7102     7114      +12     
==========================================
+ Hits         5271     5282      +11     
  Misses       1370     1370              
- Partials      461      462       +1
Impacted Files Coverage Δ
scan/schema.go 73.54% <83.33%> (+0.15%) ⬆️
scan/classifier.go 94.36% <0%> (+1.4%) ⬆️

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 bf19a93...a817a71. Read the comment docs.

@casualjim casualjim merged commit 6bc0267 into go-swagger:master May 13, 2018
@mosleim
Copy link

mosleim commented Aug 7, 2020

@casualjim is it possible to ignore only on param?

@casualjim
Copy link
Member

Use json:"-"

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

Successfully merging this pull request may close these issues.

None yet

4 participants