Skip to content
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

[PoC] Use cog to generate go and typescript models + resources #296

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions codegen/cuekind/testing/cuestomkind2.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ customKind2: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
} @cuetsy(kind="interface")
}
#InnerObject2: {
name: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
}
#Type1: {
group: string
options?: [...string]
} @cuetsy(kind="interface")
}
#Type2: {
group: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
#UnionType: #Type1 | #Type2 @cuetsy(kind="type")
}
#UnionType: #Type1 | #Type2
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time @cuetsy(kind="string")
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum")
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default"
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
}
}
}
}
88 changes: 44 additions & 44 deletions codegen/cuekind/testing/customkind.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,50 @@ customKind: {
}
"v1-0": {
schema: {
#InnerObject1: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
} @cuetsy(kind="interface")
#InnerObject2: {
name: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
#Type1: {
group: string
options?: [...string]
} @cuetsy(kind="interface")
#Type2: {
group: string
details: {
[string]: _
}
} @cuetsy(kind="interface")
#UnionType: #Type1 | #Type2 @cuetsy(kind="type")
spec: {
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time @cuetsy(kind="string")
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum")
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
status: {
statusField1: string
}
metadata: {
customMetadataField: string
otherMetadataField: string
}
spec: {
#InnerObject1: {
innerField1: string
innerField2: [...string]
innerField3: [...#InnerObject2]
}
#InnerObject2: {
name: string
details: {
[string]: _
}
}
#Type1: {
group: string
options?: [...string]
}
#Type2: {
group: string
details: {
[string]: _
}
}
#UnionType: #Type1 | #Type2
field1: string
inner: #InnerObject1
union: #UnionType
map: {
[string]: #Type2
}
timestamp: string & time.Time
enum: "val1" | "val2" | "val3" | "val4" | *"default" @cuetsy(kind="enum",memberNames="val1|val2|val3|val4|default")
i32: int32 & <= 123456
i64: int64 & >= 123456
boolField: bool | *false
floatField: float64
}
status: {
statusField1: string
}
metadata: {
customMetadataField: string
otherMetadataField: string
}
}
}
}
}
}
Loading
Loading