What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello guys, how can i load in docker under swagger in docker the glue documentation g

Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

Hello guys, how can i load in docker under swagger in docker the glue documentation generated from this command docker/sdk console rest-api:generate:documentation ? I've seen that this command generate the spryker_rest_api.schema.yml file under src/Generated/Glue/Specification but me is not clear how to load this definition into swagger... which is the public url, if exists one? thanks!

Welcome!

It looks like you're new here. Sign in or register to get started.
«1

Comments

  • Solution Architect Posts: 28 🧑🏻‍🚀 - Cadet
    edited January 2020

    You can paste it i.e.
    http://editor.swagger.io/

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    Hi Giovanni,

    Do you use the feature in docker SDK https://documentation.spryker.com/docs/spryker-in-docker-services#swagger-ui ?

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    edited January 2020

    @ULYHPR789 yes.. i can see the swagger app with my url.. but the problem is that i don't understand how to load the spryker generated documentation into swagger application web..

    swagger:
        engine: swagger-ui
        endpoints:
            swagger.<our domain>.com:
    
  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    It should be automatically done.

    https://github.com/spryker/docker-sdk/blob/master/images/swagger/Dockerfile

    Try docker/sdk up after generating spec. It should build swagger image again and catch generated yml,

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    unfortunately it s not happend.... i miss something? i just update docker sdk project and then bootstrap deploy.dev.yml and up

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    When have you generated spryker_rest_api.schema.yml? Before up or after?

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    ah maybe after... ok.. i can try to re-up docker.. i need only up or maybe before also bootstrap and then up?

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    just up. Bootstrap is only needed when SDK updated or deploy yml changed.

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    ok. i tried to up again docker (with rest api documentation already generated) but under swagger app there is always the default url about petstore and not the spryker yml... maybe i do something wrong??!

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited January 2020

    It should be OOTB.

    Would you be so kind to run the following:

    docker exec spryker_dev_swagger_1 ls -al /var/specs/
    
  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    docker exec spryker_b2b_dev_swagger_1 ls -la /var/specs/
    
    total 228
    drwxr-xr-x    2 root     root           102 Jan 29 10:16 .
    drwxrwxrwx    1 root     root          4096 Jan 28 10:12 ..
    -rw-r--r--    1 root     root        227756 Jan 29 10:15 spryker_rest_api.schema.yml
    
  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    is there!

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited January 2020
    docker exec spryker_b2b_dev_swagger_1 'echo $SWAGGER_JSON'
    
  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    with your command i get

    OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "exec: \"echo $SWAGGER_JSON\": executable file not found in $PATH": unknown
    

    withou single quote, just echo $SWAGGER_JSON then i get empty response from container

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited January 2020

    ok.
    docker exec -it spryker_b2b_dev_swagger_1 bash

    and inside echo $SWAGGER_JSON

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    ok. i wanted just this try.. 1 min

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    P.S. And in dev mode you do not need to rebuild swagger image as it just mounts the folder.

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    SWAGGER_JSON path variable is also right: /var/specs/spryker_rest_api.schema.yml

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    yes.. understand..

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    i checked later..

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    So everything is set ok. I wonder if Swagger has cached in browser. Would you able to open it in Private mode?

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    ok, i try..

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    no.. always the same

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    May be permission issue.

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    how can we check if a permission issue?

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    docker logs spryker_b2b_dev_swagger_1

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    no errors in log... only the access log infos

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    Are you on linux?

  • Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet

    no, macos

  • Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    It seems we are giving everything for swagger UI. Let’s try the following:

Welcome!

It looks like you're new here. Sign in or register to get started.