Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Explicitly set yaml names for camelCased fields #535

Merged
merged 1 commit into from
Oct 24, 2023
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
10 changes: 5 additions & 5 deletions api/adoptionplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ func (h AdoptionPlanHandler) Graph(ctx *gin.Context) {
//
// Vertex represents a vertex in the dependency graph.
type Vertex struct {
ID uint `json:"applicationId"`
Name string `json:"applicationName"`
ID uint `json:"applicationId" yaml:"applicationId"`
Name string `json:"applicationName" yaml:"applicationName"`
Decision string `json:"decision"`
EffortEstimate string `json:"effortEstimate"`
EffortEstimate string `json:"effortEstimate" yaml:"effortEstimate"`
Effort int `json:"effort"`
PositionY int `json:"positionY"`
PositionX int `json:"positionX"`
PositionY int `json:"positionY" yaml:"positionY"`
PositionX int `json:"positionX" yaml:"positionX"`
}

//
Expand Down
2 changes: 1 addition & 1 deletion api/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ type Incident struct {
File string `json:"file"`
Line int `json:"line"`
Message string `json:"message"`
CodeSnip string `json:"codeSnip"`
CodeSnip string `json:"codeSnip" yaml:"codeSnip"`
Facts FactMap `json:"facts"`
}

Expand Down
4 changes: 2 additions & 2 deletions api/assessment.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ type Assessment struct {
Questionnaire Ref `json:"questionnaire" binding:"required"`
Sections []assessment.Section `json:"sections"`
Stakeholders []Ref `json:"stakeholders"`
StakeholderGroups []Ref `json:"stakeholderGroups"`
StakeholderGroups []Ref `json:"stakeholderGroups" yaml:"stakeholderGroups"`
// read only
Risk string `json:"risk"`
Confidence int `json:"confidence"`
Status string `json:"status"`
Thresholds assessment.Thresholds `json:"thresholds"`
RiskMessages assessment.RiskMessages `json:"riskMessages"`
RiskMessages assessment.RiskMessages `json:"riskMessages" yaml:"riskMessages"`
}

//
Expand Down
8 changes: 4 additions & 4 deletions api/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ func (h *BaseHandler) Attachment(ctx *gin.Context, name string) {
//
// REST resource.
type Resource struct {
ID uint `json:"id,omitempty" yaml:",omitempty"`
CreateUser string `json:"createUser" yaml:",omitempty"`
UpdateUser string `json:"updateUser" yaml:",omitempty"`
CreateTime time.Time `json:"createTime" yaml:",omitempty"`
ID uint `json:"id,omitempty" yaml:"id,omitempty"`
CreateUser string `json:"createUser" yaml:"createUser,omitempty"`
UpdateUser string `json:"updateUser" yaml:"updateUser,omitempty"`
CreateTime time.Time `json:"createTime" yaml:"createTime,omitempty"`
}

//
Expand Down
2 changes: 1 addition & 1 deletion api/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ type StakeholderGroup struct {
Name string `json:"name" binding:"required"`
Description string `json:"description"`
Stakeholders []Ref `json:"stakeholders"`
MigrationWaves []Ref `json:"migrationWaves"`
MigrationWaves []Ref `json:"migrationWaves" yaml:"migrationWaves"`
}

//
Expand Down
10 changes: 5 additions & 5 deletions api/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,11 @@ type Import map[string]interface{}
type ImportSummary struct {
Resource
Filename string `json:"filename"`
ImportStatus string `json:"importStatus"`
ImportTime time.Time `json:"importTime"`
ValidCount int `json:"validCount"`
InvalidCount int `json:"invalidCount"`
CreateEntities bool `json:"createEntities"`
ImportStatus string `json:"importStatus" yaml:"importStatus"`
ImportTime time.Time `json:"importTime" yaml:"importTime"`
ValidCount int `json:"validCount" yaml:"validCount"`
InvalidCount int `json:"invalidCount" yaml:"invalidCount"`
CreateEntities bool `json:"createEntities" yaml:"createEntities"`
}

//
Expand Down
6 changes: 3 additions & 3 deletions api/migrationwave.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ func (h MigrationWaveHandler) Delete(ctx *gin.Context) {
type MigrationWave struct {
Resource
Name string `json:"name"`
StartDate time.Time `json:"startDate"`
EndDate time.Time `json:"endDate"`
StartDate time.Time `json:"startDate" yaml:"startDate"`
EndDate time.Time `json:"endDate" yaml:"endDate"`
Applications []Ref `json:"applications"`
Stakeholders []Ref `json:"stakeholders"`
StakeholderGroups []Ref `json:"stakeholderGroups"`
StakeholderGroups []Ref `json:"stakeholderGroups" yaml:"stakeholderGroups"`
}

//
Expand Down
8 changes: 4 additions & 4 deletions api/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ func (h ReviewHandler) CopyReview(ctx *gin.Context) {
// Review REST resource.
type Review struct {
Resource
BusinessCriticality uint `json:"businessCriticality"`
EffortEstimate string `json:"effortEstimate"`
ProposedAction string `json:"proposedAction"`
WorkPriority uint `json:"workPriority"`
BusinessCriticality uint `json:"businessCriticality" yaml:"businessCriticality"`
EffortEstimate string `json:"effortEstimate" yaml:"effortEstimate"`
ProposedAction string `json:"proposedAction" yaml:"proposedAction"`
WorkPriority uint `json:"workPriority" yaml:"workPriority"`
Comments string `json:"comments"`
Application *Ref `json:"application,omitempty" binding:"required_without=Archetype,excluded_with=Archetype"`
Archetype *Ref `json:"archetype,omitempty" binding:"required_without=Application,excluded_with=Application"`
Expand Down
2 changes: 1 addition & 1 deletion api/ruleset.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ type RuleSet struct {
Rules []Rule `json:"rules"`
Repository *Repository `json:"repository,omitempty"`
Identity *Ref `json:"identity,omitempty"`
DependsOn []Ref `json:"dependsOn"`
DependsOn []Ref `json:"dependsOn" yaml:"dependsOn"`
}

//
Expand Down
8 changes: 4 additions & 4 deletions api/stakeholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ type Stakeholder struct {
Resource
Name string `json:"name" binding:"required"`
Email string `json:"email" binding:"required"`
Groups []Ref `json:"stakeholderGroups"`
BusinessServices []Ref `json:"businessServices"`
JobFunction *Ref `json:"jobFunction"`
Groups []Ref `json:"stakeholderGroups" yaml:"stakeholderGroups"`
BusinessServices []Ref `json:"businessServices" yaml:"businessServices"`
JobFunction *Ref `json:"jobFunction" yaml:"jobFunction"`
Owns []Ref `json:"owns"`
Contributes []Ref `json:"contributes"`
MigrationWaves []Ref `json:"migrationWaves"`
MigrationWaves []Ref `json:"migrationWaves" yaml:"migrationWaves"`
}

//
Expand Down
6 changes: 3 additions & 3 deletions api/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ type Target struct {
Resource
Name string `json:"name"`
Description string `json:"description"`
Choice bool `json:"choice,omitempty"`
Custom bool `json:"custom,omitempty"`
Choice bool `json:"choice,omitempty" yaml:",omitempty"`
Custom bool `json:"custom,omitempty" yaml:",omitempty"`
Labels []Label `json:"labels"`
Image Ref `json:"image"`
RuleSet *RuleSet `json:"ruleset,omitempty"`
RuleSet *RuleSet `json:"ruleset,omitempty" yaml:"ruleset,omitempty"`
}

type Label struct {
Expand Down
2 changes: 1 addition & 1 deletion api/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ type Ticket struct {
Error bool `json:"error"`
Message string `json:"message"`
Status string `json:"status"`
LastUpdated time.Time `json:"lastUpdated"`
LastUpdated time.Time `json:"lastUpdated" yaml:"lastUpdated"`
Fields Fields `json:"fields"`
Application Ref `json:"application" binding:"required"`
Tracker Ref `json:"tracker" binding:"required"`
Expand Down
2 changes: 1 addition & 1 deletion api/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ type Tracker struct {
Kind string `json:"kind" binding:"required,oneof=jira-cloud jira-onprem"`
Message string `json:"message"`
Connected bool `json:"connected"`
LastUpdated time.Time `json:"lastUpdated"`
LastUpdated time.Time `json:"lastUpdated" yaml:"lastUpdated"`
Identity Ref `json:"identity" binding:"required"`
Insecure bool `json:"insecure"`
}
Expand Down