Open rodericj opened 4 years ago
One possibility is to use GitHub sync provided by swagger hub. https://app.swaggerhub.com/help/integrations/github-sync
It can push any saves to a branch. We can use these branches as a staging area before merging to master then tagging a release version. This is currently set up to use a branch called swaggerstaging: https://github.com/ThumbWorks/DeckOfCards/tree/Swaggerstaging.
Not bad. I did this on mobile and the file structure is different (master currently has a subset of what sync does) so we would need to test this out before merging this in.
I've attempted to build the framework in the Swaggerstaging branch but with SPM the files all need to be in a specific directory:
'DeckOfCards' /Users/roderic/dev/DeckOfCards: error: Source files for target DeckOfCards should be located under 'Sources/DeckOfCards', or a custom sources path can be set with the 'path' property in Package.swift
.
The issue is that the generator ends up putting all of the files into swift5/SwaggerGenerated or similar. Will need to reach out on the swagger hub forum https://community.smartbear.com/t5/SwaggerHub/ct-p/SwaggerHub
Relevant, the json API can be downloaded like this:
curl https://api.swaggerhub.com/apis/Thumbworks/DeckOfCards/1.0.0
We could set up a simple service which pulls that down, then follows the steps here: https://github.com/swagger-api/swagger-codegen#homebrew, then does the simple moving of the code into the correct format, then pushing to the repo. This would be awesome
I've got a local server running this command: swagger-codegen generate -i https://api.swaggerhub.com/apis/Thumbworks/DeckOfCards/1.0.0/swagger.json -l swift5 -o /tmp/generatedCode/
I'm going to create a different repo for this and I'll likely be able to close this ticket.
I've got a bit of a server working over here: https://github.com/ThumbWorks/DeckOfCardsServer. Currently this will fetch the yaml, generate the server code, then move it to the correct directory. It likely won't work on the server as I don't have access to install swagger-codegen
The current process to update this repo is the following: