Calling Developers!
We are reenergizing our code contribution process! Learn More

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

Options
giovanni.piemontese
giovanni.piemontese 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!

«1

Comments

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

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

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

    Hi Giovanni,

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

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

    @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:
    
  • sprymiker
    sprymiker Cloud Platform Architect Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    Options

    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,

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

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

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

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

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

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

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

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

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

    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??!

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

    It should be OOTB.

    Would you be so kind to run the following:

    docker exec spryker_dev_swagger_1 ls -al /var/specs/
    
  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options
    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
    
  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Löffelhardt Spryker Solution Partner Posts: 871 🧑🏻‍🚀 - Cadet
    Options

    is there!

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

    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

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

    ok.
    docker exec -it spryker_b2b_dev_swagger_1 bash

    and inside echo $SWAGGER_JSON

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

    ok. i wanted just this try.. 1 min

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

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

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

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

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

    yes.. understand..

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

    i checked later..

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

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

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

    ok, i try..

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

    no.. always the same

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

    May be permission issue.

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

    how can we check if a permission issue?

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

    docker logs spryker_b2b_dev_swagger_1

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

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

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

    Are you on linux?

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

    no, macos

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

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