Skip to content

Commit 6215d43

Browse files
codebotenAlex Boten
andauthored
remove specification for service.name (#68)
The attributes should really just be treated like a map of values. Specifying the service name here doesn't provide much value. Additionally, this is preventing the go-jsonschema library from generating the code for attributes as a map. With the service name specification, the generated code looks like this: ``` type Attributes struct { // ServiceName corresponds to the JSON schema field "service.name". ServiceName *string `mapstructure:"service.name,omitempty"` } ``` Without the service name property specified: ``` type Attributes map[string]interface{} ``` I understand this appears to be a bug in go-jsonschema, but after thinking about this, i decided to open this PR as a proposal to work around the issue. Defining the service name property made sense when we wanted to require it, but since it's not required, i dont see much benefit to having it. Signed-off-by: Alex Boten <[email protected]> Co-authored-by: Alex Boten <[email protected]>
1 parent c5128cc commit 6215d43

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

schema/resource.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@
1616
"Attributes": {
1717
"title": "Attributes",
1818
"type": "object",
19-
"additionalProperties": true,
20-
"properties": {
21-
"service.name": {
22-
"type": "string"
23-
}
24-
}
19+
"additionalProperties": true
2520
}
2621
}
2722
}

0 commit comments

Comments
 (0)