anz-bank / sysl-go

Communication library used by SYSL-generated code written in Go.
Apache License 2.0
10 stars 14 forks source link

SwaggerUI and Redoc endpoints #24

Open nofun97 opened 4 years ago

nofun97 commented 4 years ago

It was removed in #22 due to #21. We still need this feature. More research on resource injection tool is required.

Feature descriptions: Generated code will need some additional endpoints that serve SwaggerUI and Redoc. The endpoints are /-/endpoints/swaggerui/ and /-/endpoints/redoc/ respectively.

As @anzdaddy suggested:

Elements of a good resource injection tool:

    1. Supports http.FileSystem.
    2. Compresses everything with max compression by default.
    3. Uses string syntax to represent data in source code (much more compact than []byte{0x...}).
    4. Can serve gzip encoding directly to http clients without going through a decompression step.
cuminandpaprika commented 4 years ago

Some more thought should be put into how sysl-catalog integrates with the codegen capabilities of sysl.

Given our current approach with sysl catalog, we probably no longer need this feature to be implemented, since sysl-catalog recommends specs are served centrally rather than on a per-service basis.

A clarified process for how a user generates code, and creates documentation would help solidify the use-case. Ideally, an example tutorial that takes a new user through writing some sysl, running the codegen and using sysl-catalog to produce documentation for their service.