Skip to content

Commit

Permalink
fix typo seperate > separate (yonaskolb#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
zntfdr authored and kerrmarin committed Sep 28, 2021
1 parent 622b140 commit 37bb081
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ This includes a large rewrite with a lot more test cases so many more specs shou
### Fixed
- Removed symbols from generated filenames
- Generate Floats as `Float` not `Double`
- Fixed some array query parameters not joining their contents with the collectionFormat seperator (uses comma delimeted by default now if none is provided)
- Fixed some array query parameters not joining their contents with the collectionFormat separator (uses comma delimited by default now if none is provided)
- Arrays and dictionaries of enums are now encoded
- Arrays of models are now encoded
- Support for a default response with no schema
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwagGenKit/CodeFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ open class CodeFormatter {
context["requestSchemas"] = requestSchemas
context["formProperties"] = formProperties

// TODO: seperate
// TODO: separate
context["nonBodyParams"] = params.map(getParameterContext) + formProperties // params and form properties

let securityRequirements = operation.securityRequirements ?? spec.securityRequirements
Expand Down
12 changes: 6 additions & 6 deletions Sources/SwagGenKit/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ fileprivate let acronymStrings = ["URL"]

public extension String {

private func camelCased(seperator: String) -> String {
private func camelCased(separator: String) -> String {

var index = 0
let components = self.components(separatedBy: seperator)
let components = self.components(separatedBy: separator)
if uppercased() == self {
return components.map { $0.lowercased().mapFirstChar { $0.uppercased() } }.joined(separator: "")
}
Expand Down Expand Up @@ -95,11 +95,11 @@ public extension String {
return first + rest
}

private func camelCaseSeperators() -> String {
private func camelCaseSeparators() -> String {
var string = self
for separator in separators {
if string.contains(separator) {
string = string.camelCased(seperator: separator)
string = string.camelCased(separator: separator)
}
}
return string
Expand All @@ -115,7 +115,7 @@ public extension String {

func lowerCamelCased() -> String {

let string = camelCaseSeperators()
let string = camelCaseSeparators()

if string == string.uppercased(), !hasSeparator {
return string.lowercased()
Expand All @@ -128,7 +128,7 @@ public extension String {
if acronymStrings.contains(uppercased()), !hasSeparator {
return uppercased()
}
return camelCaseSeperators().mapFirstChar { $0.uppercased() }
return camelCaseSeparators().mapFirstChar { $0.uppercased() }
}
}

Expand Down
18 changes: 9 additions & 9 deletions Specs/TFL/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@
{
"name": "serviceTypes",
"in": "query",
"description": "A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"description": "A comma separated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"required": false,
"explode": true,
"schema": {
Expand Down Expand Up @@ -1156,7 +1156,7 @@
{
"name": "serviceTypes",
"in": "query",
"description": "A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"description": "A comma separated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"required": false,
"explode": true,
"schema": {
Expand Down Expand Up @@ -1236,7 +1236,7 @@
{
"name": "serviceTypes",
"in": "query",
"description": "A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"description": "A comma separated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"required": false,
"explode": true,
"schema": {
Expand Down Expand Up @@ -1327,7 +1327,7 @@
{
"name": "serviceTypes",
"in": "query",
"description": "A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"description": "A comma separated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"required": false,
"explode": true,
"schema": {
Expand Down Expand Up @@ -1592,7 +1592,7 @@
{
"name": "serviceTypes",
"in": "query",
"description": "A comma seperated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"description": "A comma separated list of service types to filter on. Supported values: Regular, Night. Defaulted to 'Regular' if not specified",
"required": false,
"explode": true,
"schema": {
Expand Down Expand Up @@ -4610,7 +4610,7 @@
{
"name": "modes",
"in": "path",
"description": "A comma-seperated list of modes e.g. tube,dlr",
"description": "A comma-separated list of modes e.g. tube,dlr",
"required": true,
"schema": {
"type": "array",
Expand Down Expand Up @@ -4682,7 +4682,7 @@
{
"name": "ids",
"in": "path",
"description": "A comma-seperated list of stop point ids. Max. approx. 20 ids.\r\n You can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name.",
"description": "A comma-separated list of stop point ids. Max. approx. 20 ids.\r\n You can use /StopPoint/Search/{query} endpoint to find a stop point id from a station name.",
"required": true,
"schema": {
"type": "array",
Expand Down Expand Up @@ -4962,7 +4962,7 @@
{
"name": "modes",
"in": "path",
"description": "A comma-seperated list of modes e.g. tube,dlr",
"description": "A comma-separated list of modes e.g. tube,dlr",
"required": true,
"schema": {
"type": "array",
Expand Down Expand Up @@ -9000,4 +9000,4 @@
}
}
}
}
}

0 comments on commit 37bb081

Please sign in to comment.