output: Only output mediaType once in docshelper JSON

Fixes #8379
This commit is contained in:
Bjørn Erik Pedersen 2021-04-01 19:02:39 +02:00
parent 7c7974b711
commit 7b4ade56dd
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -33,7 +33,7 @@ type Format struct {
// can be overridden by providing a new definition for those types.
Name string `json:"name"`
MediaType media.Type `json:"mediaType"`
MediaType media.Type `json:"-"`
// Must be set to a value when there are two or more conflicting mediatype for the same resource.
Path string `json:"path"`
@ -382,7 +382,7 @@ func (f Format) BaseFilename() string {
func (f Format) MarshalJSON() ([]byte, error) {
type Alias Format
return json.Marshal(&struct {
MediaType string
MediaType string `json:"mediaType"`
Alias
}{
MediaType: f.MediaType.String(),