A language for describing resource-oriented APIs & turning them into Swagger or resource diagrams. Oriented around the concepts we want to expose in the APIs.
Trying to generate a spec with an empty struct, at least when the struct is used in a union, results in an error messsage:
Expected "/*", "//", "\"", [ \t\r\n], or [a-zA-Z_] but "}" found., location: 186, 1.
The motivation for doing this is that I want to be able to have a union type where one of the possible types doesn't require additional properties. Here's an example to illustrate a use case:
"Describes how a particular column should be treated with respect to fields."
union Treatment {
mapToExistingField: MapToExistingField
unmap: LeaveUnmapped
}
structure MapToExistingField {
fieldId: long
}
"Use this to indicate that a Column should intentionally be left unmapped to a field."
structure LeaveUnmapped {
// There doesn't need to be anything in this structure.
}
Expected Behavior
I should be able to create a structure with no properties. I'd expect that inlining that structure S in a resource or other structure adds no properties and that a property with type S always can only hold an empty object.
Reslang Version
I'm using the docker image with ID 8bc0860fb6ec, which is gcr.i o/liveramp-eng/reslang:master at time of writing. I get the same error when using the reslang CLI tool with version v2.2.5 directly.
Describe The Bug
Trying to generate a spec with an empty struct, at least when the struct is used in a
union
, results in an error messsage:Expected "/*", "//", "\"", [ \t\r\n], or [a-zA-Z_] but "}" found., location: 186, 1
.The motivation for doing this is that I want to be able to have a union type where one of the possible
type
s doesn't require additional properties. Here's an example to illustrate a use case:To Reproduce
./generate-specs.sh specs-draft/field-mapper
Expected Behavior I should be able to create a structure with no properties. I'd expect that inlining that structure S in a resource or other structure adds no properties and that a property with type S always can only hold an empty object.
Reslang Version
I'm using the docker image with ID
8bc0860fb6ec
, which isgcr.i o/liveramp-eng/reslang:master
at time of writing. I get the same error when using thereslang
CLI tool with versionv2.2.5
directly.