Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Fix set param id attribute #45

Merged
merged 1 commit into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion metaschema/types.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ type {{toCamel .Name}} struct {
{{- if eq "profile" .Name}}
ID string `xml:"id,attr,omitempty" json:"id,omitempty"`
{{- end}}
{{- range .Flags}}
{{- range .Flags}}
{{- $cf := commentFlag .Name $m.DefineFlag}}
{{- range $cf}}
// {{ . }}
{{- end}}
{{- $dt := parseDatatype .Datatype $packageName}}
{{- if and (eq "id" .Name) (eq "profile" $packageName)}}
Id string `xml:"param-id,attr,omitempty" json:"id,omitempty"`
{{- else}}
{{toCamel .Name}} {{if eq "" $dt}}string{{else}}{{$dt}}{{end}} `xml:"{{ .Name }},attr,omitempty" json:"{{toLowerCamel .Name}},omitempty"`
{{- end}}
{{- end}}

{{- range .Model.Field}}
{{toCamel .Named}} {{if requiresPointer .Named $m}}*{{end}}{{packageImport .Named $m}}{{toCamel .Named}} `xml:"{{ .Named }},omitempty" json:"{{toLowerCamel .Named}},omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion types/oscal/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Exclude struct {

// A parameter setting, to be propagated to points of insertion
type SetParam struct {
Id string `xml:"id,attr,omitempty" json:"id,omitempty"`
Id string `xml:"param-id,attr,omitempty" json:"id,omitempty"`
Class string `xml:"class,attr,omitempty" json:"class,omitempty"`
DependsOn string `xml:"depends-on,attr,omitempty" json:"dependsOn,omitempty"`
Label catalog.Label `xml:"label,omitempty" json:"label,omitempty"`
Expand Down