Skip to content
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

Wrong Documentation #85

Closed
razvangvr opened this issue Feb 24, 2023 · 1 comment
Closed

Wrong Documentation #85

razvangvr opened this issue Feb 24, 2023 · 1 comment

Comments

@razvangvr
Copy link

razvangvr commented Feb 24, 2023

Please note that this part of the documentation is wrong/incomplete (and I wasted 2hours trying to get it to work)

Also, you can use Docker Compose. Example of docker-compose.yml

version: '3.0'

services:
  openapi_mock:
    container_name: openapi_mock
    image: muonsoft/openapi-mock
    environment:
      OPENAPI_MOCK_SPECIFICATION_URL: 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml'
    ports:
      - "8080:8080"

__

Examples

https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml loads a file from a URL.
path/to/your/openapi-specification.yaml loads a file relative to working directory.
./path/to/your/openapi-specification.yaml loads a file relative to configuration file.
/path/to/your/openapi-specification.yaml loads a file by absolute path.

Correct Documentation for docker compose, if you want to load the OpenApi .yaml file from local

If you want to reference a local file in docker compose

  • you must first mount the host dir into container- ./swagger:/etc/swagger
  • only then can you reference it
version: '3.0'

services:
  openapi_mock:
    container_name: openapi_mock
    image: muonsoft/openapi-mock
    volumes:
      - ./swagger:/etc/swagger
    environment:
      OPENAPI_MOCK_SPECIFICATION_URL: '/etc/swagger/studentapi.yaml'
    ports:
      - "8009:8080"

So it would help people if you can add in docker-compose documentation also an example with a .yaml file from local machine

strider2038 added a commit that referenced this issue Mar 11, 2023
#85 docker compose local file example in readme
@strider2038
Copy link
Collaborator

@razvangvr thanks for the note. I've updated README.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants