mirror of
https://github.com/niusmallnan/steve.git
synced 2025-09-10 09:30:01 +00:00
Don't set type in mapper but instead the store
This commit is contained in:
2
vendor/github.com/rancher/norman/pkg/parse/parse.go
generated
vendored
2
vendor/github.com/rancher/norman/pkg/parse/parse.go
generated
vendored
@@ -105,7 +105,7 @@ func Parse(apiOp *types.APIRequest, urlParser URLParser) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if apiOp.Schema == nil {
|
||||
if apiOp.Schema == nil && apiOp.Schemas != nil {
|
||||
apiOp.Schema = apiOp.Schemas.Schema(apiOp.Type)
|
||||
}
|
||||
|
||||
|
1
vendor/github.com/rancher/norman/pkg/store/proxy/proxy_store.go
generated
vendored
1
vendor/github.com/rancher/norman/pkg/store/proxy/proxy_store.go
generated
vendored
@@ -319,5 +319,6 @@ func (s *Store) fromInternal(apiOp *types.APIRequest, schema *types.Schema, data
|
||||
schema.Mapper.FromInternal(data)
|
||||
}
|
||||
|
||||
data["type"] = schema.ID
|
||||
return data
|
||||
}
|
||||
|
6
vendor/github.com/rancher/norman/pkg/types/mapper.go
generated
vendored
6
vendor/github.com/rancher/norman/pkg/types/mapper.go
generated
vendored
@@ -90,12 +90,6 @@ func (t *typeMapper) FromInternal(data map[string]interface{}) {
|
||||
}
|
||||
}
|
||||
|
||||
if t.root {
|
||||
if _, ok := data["type"]; !ok {
|
||||
data["type"] = t.typeName
|
||||
}
|
||||
}
|
||||
|
||||
Mappers(t.Mappers).FromInternal(data)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user