mirror of
https://github.com/rancher/norman.git
synced 2025-09-17 15:49:53 +00:00
Don't generate the ID field
This commit is contained in:
@@ -101,6 +101,9 @@ func getTypeString(nullable bool, typeName string, schema *types.Schema, schemas
|
|||||||
func getTypeMap(schema *types.Schema, schemas *types.Schemas) map[string]fieldInfo {
|
func getTypeMap(schema *types.Schema, schemas *types.Schemas) map[string]fieldInfo {
|
||||||
result := map[string]fieldInfo{}
|
result := map[string]fieldInfo{}
|
||||||
for name, field := range schema.ResourceFields {
|
for name, field := range schema.ResourceFields {
|
||||||
|
if strings.EqualFold(name, "id") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
result[field.CodeName] = fieldInfo{
|
result[field.CodeName] = fieldInfo{
|
||||||
Name: name,
|
Name: name,
|
||||||
Type: getGoType(field, schema, schemas),
|
Type: getGoType(field, schema, schemas),
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
|
const (
|
||||||
|
ResourceFieldID = "id"
|
||||||
|
)
|
||||||
|
|
||||||
type Collection struct {
|
type Collection struct {
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
Links map[string]string `json:"links"`
|
Links map[string]string `json:"links"`
|
||||||
|
Reference in New Issue
Block a user