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

fix: format on primitive types #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 1 addition & 8 deletions integration_test/test_data/spec/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"description": "extra field",
"schema": {
"type": "string",
"format": "string",
"description": "extra field"
}
}
Expand Down Expand Up @@ -219,7 +218,6 @@
"required": true,
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.id! Planogram dbKey [comma separated list]"
}
},
Expand All @@ -230,7 +228,6 @@
"required": true,
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.locationId! Location ID"
}
},
Expand All @@ -240,7 +237,6 @@
"description": "Includes. Can be: position, fixture, liveFlrFixture",
"schema": {
"type": "string",
"format": "string",
"description": "Includes. Can be: position, fixture, liveFlrFixture"
}
},
Expand All @@ -250,7 +246,6 @@
"description": "Use as filter.commodity! Commodity",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.commodity! Commodity"
}
},
Expand All @@ -260,7 +255,6 @@
"description": "Use as filter.commodityGroup! Commodity Group",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.commodityGroup! Commodity Group"
}
},
Expand All @@ -270,7 +264,6 @@
"description": "Use as filter.isDigitalScreen! IsDigitalScreen. Can be: true, false",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.isDigitalScreen! IsDigitalScreen. Can be: true, false"
}
}
Expand Down Expand Up @@ -549,4 +542,4 @@
]
}
]
}
}
7 changes: 0 additions & 7 deletions integration_test/test_data/spec/expected_with_pkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"description": "extra field",
"schema": {
"type": "string",
"format": "string",
"description": "extra field"
}
}
Expand Down Expand Up @@ -219,7 +218,6 @@
"required": true,
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.id! Planogram dbKey [comma separated list]"
}
},
Expand All @@ -230,7 +228,6 @@
"required": true,
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.locationId! Location ID"
}
},
Expand All @@ -240,7 +237,6 @@
"description": "Includes. Can be: position, fixture, liveFlrFixture",
"schema": {
"type": "string",
"format": "string",
"description": "Includes. Can be: position, fixture, liveFlrFixture"
}
},
Expand All @@ -250,7 +246,6 @@
"description": "Use as filter.commodity! Commodity",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.commodity! Commodity"
}
},
Expand All @@ -260,7 +255,6 @@
"description": "Use as filter.commodityGroup! Commodity Group",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.commodityGroup! Commodity Group"
}
},
Expand All @@ -270,7 +264,6 @@
"description": "Use as filter.isDigitalScreen! IsDigitalScreen. Can be: true, false",
"schema": {
"type": "string",
"format": "string",
"description": "Use as filter.isDigitalScreen! IsDigitalScreen. Can be: true, false"
}
}
Expand Down
6 changes: 3 additions & 3 deletions parser/utils/type_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

var GoTypesOASFormats = map[string]string{
"bool": "boolean",
"bool": "",
"uint": "int64",
"uint8": "int64",
"uint16": "int64",
Expand All @@ -21,7 +21,7 @@ var GoTypesOASFormats = map[string]string{
"int64": "int64",
"float32": "float",
"float64": "double",
"string": "string",
"string": "",
"error": "error",
}

Expand Down Expand Up @@ -128,7 +128,7 @@ func GetModuleNameFromGoMod(path string) string {
}

func IsInStringList(list []string, s string) bool {
for i, _ := range list {
for i := range list {
if list[i] == s {
return true
}
Expand Down
Loading