diff --git a/.github/workflows/samples-crystal.yaml b/.github/workflows/samples-crystal.yaml new file mode 100644 index 000000000000..41ccc2c2b1fc --- /dev/null +++ b/.github/workflows/samples-crystal.yaml @@ -0,0 +1,37 @@ +name: Samples Crystal clients + +on: + push: + paths: + - samples/client/petstore/crystal/** + pull_request: + paths: + - samples/client/petstore/crystal/** +jobs: + build: + name: Build Crystal projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # clients + - samples/client/petstore/crystal/ + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + steps: + - uses: actions/checkout@v5 + - name: Install Crystal + uses: crystal-lang/install-crystal@v1 + - name: Shards Install + run: shards install + working-directory: ${{ matrix.sample }} + - name: Run tests + run: crystal spec + working-directory: ${{ matrix.sample }} diff --git a/modules/openapi-generator/src/test/resources/3_0/crystal/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/crystal/petstore.yaml index 21cb43dc5fc1..bb92fd476c65 100644 --- a/modules/openapi-generator/src/test/resources/3_0/crystal/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/crystal/petstore.yaml @@ -1,6 +1,6 @@ openapi: 3.0.0 servers: - - url: 'http://petstore.swagger.io/v2' + - url: 'http://localhost/v2' info: description: >- This is a sample server Petstore server. For this sample, you can use the api key @@ -636,7 +636,7 @@ components: type: oauth2 flows: implicit: - authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + authorizationUrl: 'http://localhost/api/oauth/dialog' scopes: 'write:pets': modify pets in your account 'read:pets': read your pets diff --git a/samples/client/petstore/crystal/.openapi-generator-ignore b/samples/client/petstore/crystal/.openapi-generator-ignore index 7484ee590a38..82e4e79984b4 100644 --- a/samples/client/petstore/crystal/.openapi-generator-ignore +++ b/samples/client/petstore/crystal/.openapi-generator-ignore @@ -21,3 +21,5 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index 5b381bfe02e4..32824b7b8e82 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -130,7 +130,7 @@ module Petstore # Create a new `Configuration`. def initialize @scheme = "http" - @host = "petstore.swagger.io" + @host = "localhost" @base_path = "/v2" @server_index = 0 @server_operation_index = {} of Symbol => String @@ -237,7 +237,7 @@ module Petstore def server_settings [ { - url: "http://petstore.swagger.io/v2", + url: "http://localhost/v2", description: "No description provided", } ]