-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
API Swagger Json files should be added to the .gitignore #256
Comments
The swagger api files are included on purpose, the same for the generated Unless you are making API modifications, there is no need to run diff --git a/protoc-gen-swagger/genswagger/template.go b/protoc-gen-swagger/genswagger/template.go
index f12ea38..cc98e77 100644
--- a/protoc-gen-swagger/genswagger/template.go
+++ b/protoc-gen-swagger/genswagger/template.go
@@ -107,7 +107,7 @@ func queryParams(message *descriptor.Message, field *descriptor.Field, prefix st
desc = strings.TrimSpace(schema.Title + ". " + schema.Description)
}
param := swaggerParameterObject{
- Name: prefix + field.GetName(),
+ Name: prefix + field.GetJsonName(),
Description: desc,
In: "query",
Type: schema.Type,
@@ -143,7 +143,7 @@ func queryParams(message *descriptor.Message, field *descriptor.Field, prefix st
return nil, fmt.Errorf("unknown message type %s", fieldType)
}
for _, nestedField := range msg.Fields {
- p, err := queryParams(msg, nestedField, prefix+field.GetName()+".", reg, pathParams)
+ p, err := queryParams(msg, nestedField, prefix+field.GetJsonName()+".", reg, pathParams)
if err != nil {
return nil, err
}
@@ -251,7 +251,7 @@ func renderMessagesAsDefinition(messages messageMap, d swaggerDefinitionsObject,
panic(err)
}
- schema.Properties = append(schema.Properties, keyVal{f.GetName(), fieldValue})
+ schema.Properties = append(schema.Properties, keyVal{f.GetJsonName(), fieldValue})
}
d[fullyQualifiedNameToSwaggerName(msg.FQMN(), reg)] = schema
} |
Is this a bug or a feature request?
Bug
What did you expect?
I expect that when I perform a make command that generates a bunch of generated files, it shouldn't show up in the change list.
If these files are generated, shouldn't they be added to the .gitignore? This way when you perform modifications and commits, you don't have a polluted changelist.
What happened?
When performing a build from scratch, following the instructions given for the build using the makefile, building the API files performs a bunch of modifications
*.swagger.json
files that are in theapi
directory.What version are your using?
Master branch (commit
12076fa189a8e59ae9941945eb233fced8726dd4
)How can your issue be reproduced?
Could you share your log output?
The text was updated successfully, but these errors were encountered: