Skip to content

singletonsd/scripts-swagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SINGLETON SD - SCRIPTS - SWAGGER

This project contains swagger Linux bash scripts to generate swagger libraries from a spec file. It uses Swagger Code Generator and OpenApi Generator.

The main repository is hosted in gitlab.com/singletonsd/scripts/swagger but it is automatically mirrored to github.com/singletonsd, github.com/patoperpetua and to gitlab.com/patoperpetua. If you are in the Github page it may occur that is not updated to the last version.

AVAILABLE SCRIPTS

BINARIES DOWNLOADER

It downloads the .jar file to generate libraries.

curl -s https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_binaries_dowloader.sh | bash /dev/stdin

It can be downloaded by:

curl -o swagger_binaries_downloader.sh -L https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_binaries_dowloader.sh

SWAGGER GENERATE ANDROID

It generates an android library of the provided script. It contains the following options:

SWAGGER_API_SPEC=#location of spec, it can be local or url
SWAGGER_GROUP=#group name. MANDATORY
SWAGGER_ARTIFACT=#artifact name. MANDATORY
SWAGGER_VERSION=

It can be downloaded by:

mkdir -p scripts && \
curl -o scripts/swagger_binaries_downloader.sh -L https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_binaries_downloader.sh && \
curl -o scripts/swagger_generate_android.sh -L https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_generate_android.sh && \
chmod +x scripts/swagger_binaries_downloader.sh scripts/swagger_generate_android.sh

SWAGGER GENERATE ANGULAR

It generates an typescript angular library of the provided script. It contains the following options:

SWAGGER_API_SPEC=#location of spec, it can be local or url

It can be downloaded by:

mkdir -p scripts && \
curl -o scripts/swagger_binaries_downloader.sh -L https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_binaries_downloader.sh && \
curl -o scripts/swagger_generate_angular.sh -L https://singletonsd.gitlab.io/scripts/swagger/latest/swagger_generate_angular.sh && \
chmod +x scripts/swagger_binaries_downloader.sh scripts/swagger_generate_angular.sh && \
./scripts/swagger_generate_angular.sh

DOWNLOAD

All scripts are available also inside a zip file under this url. Or you can execute the following to download:

mkdir -p binaries && \
curl -o binaries/scripts.zip -L https://singletonsd.gitlab.io/scripts/swagger/latest/scripts.zip && \
cd binaries && unzip scripts.zip && mv src/* . && rm -r src && rm -r scripts.zip && cd ..

GIT HOOK

You can setup shellcheck to be run before a commit. To do that just execute the following script under your git repository:

curl -s https://singletonsd.gitlab.io/scripts/common/latest/bash_script_test_hook_installer.sh | bash /dev/stdin

STRUCTURE

Master branch is setup as latest folder. To use an specific version, put the version name before the file name like:

https://singletonsd.gitlab.io/scripts/swagger/latest/bash_script_test_standalone.sh
https://singletonsd.gitlab.io/scripts/swagger/develop/bash_script_test_standalone.sh
https://singletonsd.gitlab.io/scripts/swagger/v0.0.2/bash_script_test_standalone.sh

DOCUMENTATION

TODO

  • Fix documentation.
  • Add script to download test script from gitlab pages.
  • Zip all scripts and put inside pages.
  • Create a docker image with all scripts inside.
  • Improve generators. Add more information.

© Singleton SD, France, 2019.

About

This project contains swagger Linux bash scripts to generate swagger libraries from a spec file. It uses Swagger Code Generator] and OpenApi Generator.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages