Skip to content

[swift5] fixes a bug encoding/decoding decimal#13589

Merged
4brunu merged 2 commits intoOpenAPITools:masterfrom
Feuerwerk:swift-decimal-coding
Oct 5, 2022
Merged

[swift5] fixes a bug encoding/decoding decimal#13589
4brunu merged 2 commits intoOpenAPITools:masterfrom
Feuerwerk:swift-decimal-coding

Conversation

@Feuerwerk
Copy link
Contributor

@jgavris @ehyche @Edubits @jaz-ah @4brunu

Fixes the bug described in #13410
Tested with OpenAPI generator 6.2.1-snapshot and a Swift Client on iOS 14.7
All 3 commands (mvnw clean package, generate-samples.sh, export_docs_generators.sh) ran successfully.

}
}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encode(_ value: Decimal, forKey key: Self.Key) throws {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feuerwerk can you please fix the indentation here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, yes. Weird, i copied the indentations from the existing lines to match exactly the style. I will have a look.

try encode(stringValue, forKey: key)
}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} mutating func encodeIfPresent(_ value: Decimal?, forKey key: Self.Key) throws {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feuerwerk can you please fix the indentation here?

return map
}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func decode(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feuerwerk can you please fix the indentation here?

return decimalValue
}

{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func decodeIfPresent(_ type: Decimal.Type, forKey key: Self.Key) throws -> Decimal? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Feuerwerk can you please fix the indentation here?

Copy link
Contributor

@4brunu 4brunu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants