Git Product home page Git Product logo

ddev-swagger-ui's Introduction

tests project is maintained

What is ddev-swagger-ui?

This repository provides Swagger UI as a DDEV add-on to serve a web-ui for a OpenAPI/Swagger (api documentation) file.

This addon is based on the Swagger UI Docker Image.

Advanced documentation can be found in the Swagger UI Docker Docs.

DDEV docs for Additional Service Configurations & Add-ons

Using ddev-swagger-ui within a project

Dependencies

Make sure you have DDEV v1.22.1+ installed

Install

  1. cd into your project directory
  2. Run ddev config and answer the questions as appropriate
  3. Run ddev get reloxx13/ddev-swagger-ui and answer the questions as appropriate
  4. Run ddev start or ddev restart

Upgrade

To upgrade your version of ddev-swagger-ui, repeat the ddev get reloxx13/ddev-swagger-ui to get the latest release. To see the installed version, ddev get --installed.

Notes

What does it do right now?

  • Provides the following swagger-ui-docker-provided environmental variables:
    • PORT=8080
    • BASE_URL=/
    • SWAGGER_JSON=/var/www/html/swagger.json
    • SWAGGER_JSON_URL=

ddev-swagger-ui's People

Contributors

reloxx13 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ddev-swagger-ui's Issues

Tests not working - is this maintained?

I see that the automated tests aren't working now and maybe haven't ever?

If this is intended to be a maintained add-on, could you get them going?

If not, would you mind removing the ddev-get topic from the repo so it doesn't confuse people?

Thanks!
-Randy

Suggestions for ddev-swagger-ui

Thanks for this contribution and for being willing to maintain it!

Just some thoughts looking through:

  1. The README assumes that people already know what swagger is and why they would want it. I don't. Maybe you can add a little more about "Why would I use this add-on?"
  2. Why would one use swagger inside a project? Isn't it a standalone tool? How does it help to have it in a project? (That's the kind of thing that can go in the README as well)
  3. As noted elsewhere, I'm not a maintainer of this, so remove my name from the bottom. I don't know a thing about swagger.
  4. You're using HTTP_EXPOSE and HTTPS_EXPOSE on the same port, 8080. That won't work for most browsers. I don't know how it can be working for you. They should be two different ports (but point to the same 8080 that's exposed inside the container)
  5. I recommend using something other than 8080/8081 as the HTTP*_EXPOSE anyway because that's a very commonly used port and is likely to cause trouble. Try 9080/9081 maybe.
  6. I usually recommend using an explicit tag for the image. You have image: swaggerapi/swagger-ui which actually means image: swaggerapi/swagger-ui:latest, and on most docker images latest is a tag that is moved all the time, which means your add-on can suddenly break for people when it's changed upstream.
  7. The version tag is obsolete and no longer used in docker-compose, so you can remove that.

Again, thanks for the contribution!

Tests failing, ports problem

Hey @rfay,

I cannot get the port and tests fixed, could you take a look?

The test is calling a curl on a localhost URL (taken from other DDEV add-ons), but it cannot reach the Swagger UI instance.

I'm not sure if I set up the ports correctly in the compose yaml.

I added multiple curl test.

# Restarted test-swagger-ui
# Your project can be reached at https://test-swagger-ui.ddev.site/ https://127.0.0.1:32778/
# Failed to execute command curl -s http://localhost:8080: exit status 7
# ddev get ddev/ddev-swagger-ui with project test-swagger-ui in /home/runner/tmp/test-swagger-ui (/home/runner/tmp/test-swagger-ui)
not ok 2 install from release

curl command outside on https://test-swagger-ui.ddev.site works in test and loading the addon in my project works fine, too.

Would be very kind if you can take a look.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.