-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added OpenAPI Generator #35
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# OpenAPI Generator Ignore | ||
|
||
# example usage | ||
# **/Modules/Core/Sources/Models/Generated/**/Filename.swift |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"projectName": "{{cookiecutter.projectName}}", | ||
"readonlyProperties": true, | ||
"responseAs": "Combine", | ||
"swiftPackagePath": "/", | ||
"validateSpec": false, | ||
"validatable": false, | ||
"useJsonEncodable": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
cd $(dirname $0) | ||
|
||
# if you want to supply your swagger.yml directly, | ||
# comment the next two lines and create a swagger.yml | ||
rm -rf swagger.yml; | ||
curl -o swagger.yml {{cookiecutter.swaggerURL}}; | ||
|
||
rm -rf ../Modules/Core/Sources/Models/Generated; | ||
|
||
openapi-generator generate -i swagger.yml \ | ||
-g swift5 \ | ||
-o ../Modules/Core/Sources/Models/Generated \ | ||
-c generator-config.json \ | ||
--global-property models,modelDocs=false,modelTests=false \ | ||
--ignore-file-override=./.openapi-generator-ignore \ | ||
--type-mappings uuid4=UUID; | ||
|
||
mv ../Modules/Core/Sources/Models/Generated/Models/* ../Modules/Core/Sources/Models/Generated/; | ||
rm -rf ../Modules/Core/Sources/Models/Generated/Models; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
cd $(dirname $0) | ||
|
||
./APIGeneration/make | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is there an extra script for the generation? Am I missing something or could this be simplified to one script? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it makes sense to have everything generation related in an own folder and this script is just for convenience from the root folder - we can also move everything in here if you want |
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.
add instructions on how to execute the model generation