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

skip flag not working field custom types mapping #15

Closed
bcordobaq opened this issue Feb 1, 2023 · 2 comments · Fixed by #47
Closed

skip flag not working field custom types mapping #15

bcordobaq opened this issue Feb 1, 2023 · 2 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@bcordobaq
Copy link

Hi, I realized that go-swagger3 still continues with the type mapping for those fields marked with skip: "true".
For example:

type Foo struct {
  field1 string `json:"field1"`
  field2 string `json:"field2"`
  field3 Bar `json:"field3" skip:"true"`
}

type Bar struct {
  ...
}

And, if I don't want to map the Bar type, it also processes it.

@parvez3019
Copy link
Owner

@gocodify do you want to take a look at this one?

@qequ qequ added the bug Something isn't working label Mar 29, 2023
@qequ
Copy link
Collaborator

qequ commented May 2, 2023

For more clarification, this bug only affects custom types made by user. In the case of the example made by @bcordobaq
the tool will generate inside schemas' component section an element Bar that is not used anywhere else


"components": {
    "schemas": {
         ...
       pkg.path....Bar: {
           ...
        }
    }
}

Possibly need to check the process of creating components and ensure the custom types are used

@qequ qequ changed the title skip flag not working field types mapping skip flag not working field custom types mapping May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants