1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-12 04:29:33 +00:00

write writeOnly fields on create

This commit is contained in:
Darren Shepherd
2018-01-19 21:28:40 -07:00
parent 76d8256085
commit 8982c1cc59
2 changed files with 20 additions and 9 deletions

View File

@@ -95,7 +95,11 @@ func (j *JSONResponseWriter) convert(b *builder.Builder, context *types.APIConte
if schema == nil {
return nil
}
data, err := b.Construct(schema, input, builder.List)
op := builder.List
if context.Method == http.MethodPost {
op = builder.ListForCreate
}
data, err := b.Construct(schema, input, op)
if err != nil {
logrus.Errorf("Failed to construct object on output: %v", err)
return nil