Skip to content

Commit

Permalink
remove specification for service.name (#68)
Browse files Browse the repository at this point in the history
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 <aboten@lightstep.com>
Co-authored-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
codeboten and Alex Boten authored Mar 1, 2024
1 parent c5128cc commit 6215d43
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions schema/resource.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
"Attributes": {
"title": "Attributes",
"type": "object",
"additionalProperties": true,
"properties": {
"service.name": {
"type": "string"
}
}
"additionalProperties": true
}
}
}

0 comments on commit 6215d43

Please sign in to comment.