-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[swift5] Refactor encodeToJSON #10961
Conversation
@4brunu |
@@ -0,0 +1,24 @@ | |||
set(CPACK_PACKAGE_NAME lib${pkgName}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@funzin is this here by accident?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/OpenAPITools/openapi-generator/runs/4324214455?check_suite_focus=tru
Maybe, these files shoud be tracked.
} | ||
|
||
extension URL: JSONEncodable { | ||
func encodeToJSON() -> Any { | ||
return self | ||
} | ||
} | ||
|
||
extension UUID: JSONEncodable { | ||
func encodeToJSON() -> Any { | ||
return self.uuidString | ||
} | ||
}{{/useVapor}}{{#generateModelAdditionalProperties}} | ||
{{/useVapor}}{{#generateModelAdditionalProperties}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@funzin can you please make this one line only to avoid generate extra new lines? Thanks
}{{/useVapor}}{{#generateModelAdditionalProperties}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unserstand:+1:
Remove empty lines
e69c46f
This reverts commit cb52547.
Hum, it looks like it's a file from the |
Add Packing.cmake |
Circle CI & BItrise failed but it's not related to this pr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that CI failure is not related to this PR.
Looks good to me 👍
@funzin thanks for creating multiple PR that improve the Swift Generator.
Looking forward to review more PRs of yours 👍
I've restarted https://app.bitrise.io/build/69fe6309-6ba6-4859-bbf0-b3890d47fc53#?tab=log. Let's see how it goes |
Refactor encodeToJSON
Some types return
self
only so we can skip same code using protocol extension method.if type is
UUID
,Int16
,Int32
, we can return self.I checked correct judgment.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x