go-swagger3 icon indicating copy to clipboard operation
go-swagger3 copied to clipboard

`skip` flag not working field custom types mapping

Open bcordobaq opened this issue 2 years ago • 2 comments

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.

bcordobaq avatar Feb 01 '23 19:02 bcordobaq

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

parvez3019 avatar Feb 02 '23 10:02 parvez3019

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 avatar May 02 '23 18:05 qequ