24 lines
488 B
V
24 lines
488 B
V
module codegen
|
|
|
|
import log
|
|
import freeflowuniverse.herolib.core.code
|
|
|
|
fn test_struct_to_schema() {
|
|
struct_ := code.Struct{
|
|
name: 'test_name'
|
|
description: 'a codemodel struct to test struct to schema serialization'
|
|
fields: [
|
|
code.StructField{
|
|
name: 'test_field'
|
|
description: 'a field of the test struct to test fields serialization into schema'
|
|
typ: code.Type{
|
|
symbol: 'string'
|
|
}
|
|
},
|
|
]
|
|
}
|
|
|
|
schema := struct_to_schema(struct_)
|
|
log.debug(schema.str())
|
|
}
|