Skip to content

Conversation

@DmitryAnansky
Copy link
Contributor

@DmitryAnansky DmitryAnansky commented Feb 21, 2025

What/Why/How?

As openapiOperation.servers[0] already have servers resolved with priority of Operation--Path--Root (from higher to lower) we extend it to also resolve complex server url description with variables, default value will be selected and resolved in the final server url.

  - url: https://{region}-server-with-vars.com/v1
    description: Regional server
    variables:
      region:
        default: us
        enum:
          - us
          - eu
          - asia

Reference

Closes: https://github.com/Redocly/redocly/issues/11205

Testing

openapi: 3.1.0
info:
  title: Minimal API
  version: 1.0.0
security: []
servers:
  - url: https://{region}.{task}-server-with-vars.{domain}/v1
    description: Regional server
    variables:
      region:
        default: us
        enum:
          - us
          - eu
          - asia
      task:
        default: ping
      domain:
        default: com
  - url: https://top-level-server.com
    description: Production server
  - url: https://top-level-server-2.com
    description: Staging server
paths:
  /ping:
    servers:
      - url: https://path-level-server.com
        description: Ping-specific server
    get:
      operationId: ping
      summary: Ping the server
      servers:
        - url: https://{region}@{task}.{region}.operation-level.com/v1
          description: Regional server
          variables:
            region:
              default: us
              enum:
                - us
                - eu
                - asia
            task:
              default: ping
      responses:
        '200':
          description: Successful response
arazzo: 1.0.1
info:
  title: servers
  description: servers
  version: 1.0.0

sourceDescriptions:
  - name: servers
    type: openapi
    url: api-servers.yaml

workflows:
  - workflowId: get-servers
    description: get servers
    steps:
      - stepId: ping
        operationId: ping

Screenshots (optional)

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2025

⚠️ No Changeset found

Latest commit: 697d11a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 79.57% 6922/8699
🟡 Branches 68.89% 2868/4163
🟡 Functions 75.55% 1140/1509
🟡 Lines 79.94% 6595/8250
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / get-request-data-from-openapi.ts
67.86% (-10.71% 🔻)
68.18% (-1.82% 🔻)
66.67% (-11.11% 🔻)
67.86% (-10.71% 🔻)

Test suite run success

1323 tests passing in 189 suites.

Report generated by 🧪jest coverage report action from 697d11a

@DmitryAnansky DmitryAnansky marked this pull request as ready for review February 21, 2025 13:35
@DmitryAnansky DmitryAnansky requested a review from a team as a code owner February 21, 2025 13:35
@DmitryAnansky DmitryAnansky merged commit 656c429 into feat/introduce-respect Feb 21, 2025
35 checks passed
@DmitryAnansky DmitryAnansky deleted the feat/resolve-server-url branch February 21, 2025 15:20
DmitryAnansky added a commit that referenced this pull request Feb 21, 2025
* feat: add respect to cli

* chore: prettier

* chore: changes to e2e and rename to respect-core

* feat: remove respect auth

* fix: add ignored module

* chore: add files

* fix: type issue in utils

* fix: update all e2e tests

* chore: renaming

* chore: fix and simplify go-to logic

* chore: fix lint and unit tests

* chore: fix e2e for new goto

* chore: fix scripts to support respect-core

* fix parser:generate

* chore: rename ResultObject type

* chore: remove todos

* chore: sync package-lock

* chore: fix some lint errors

* chore: add secret

* chore: prettier fix

* chore: add abnf-parser to prettierignore

* chore: publish respect-core snaphot to npm

* chore: comment ignored e2e snapshot and update regexp

* fix: update cert regexp

* chore: try fixing publish and yarn smokes

* chore: try fixing publish

* chore: try fixing publish and remove smokes for node 14 and 16

* chore: fix docker smoke test

* chore: improve README and CONTRIBUTING files

* fix: cookies from workflows and step are not set to the request (#1918)

* chore: update respect command handler (#1920)

* fix: the $file decorator resolves wrong path to the file (#1921)

* chore: improve performance (#1924)

* fix: kebab case command options & mtls path & remove residensy (#1925)

* chore: cleanup resources folder (#1926)

* fix: revert dynamic imports

* chore: add dynamic import back

* chore: rename workflowId to workflowName and also targetWorkflow (#1927)

* chore: rename workflowId to workflowName and also targetWorkflow

* chore: fix tests and move outputs calc lower

* chore: run prettier

* Update packages/respect-core/src/modules/flow-runner/call-api-and-analyze-results.ts

Co-authored-by: Andrew Tatomyr <[email protected]>

---------

Co-authored-by: Andrew Tatomyr <[email protected]>

* chore: update package lock (#1929)

* feat: remove extendend option from generate-arazzo command (#1930)

* chore: fix e2e snapshots escape seq

* chore: simplify nested workflows output and flow

* chore: verbose flag was lost for nested workflows (#1934)

* chore: refactor types, descriptions and names (#1932)

* chore: improve tests (#1935)

* feat: resolve server url (#1936)

* chore: implement new json output and improve counting of steps

---------

Co-authored-by: DmitryAnansky <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
Co-authored-by: Andrew Tatomyr <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
DmitryAnansky added a commit that referenced this pull request Feb 24, 2025
* feat: add respect to cli

* chore: prettier

* chore: changes to e2e and rename to respect-core

* feat: remove respect auth

* fix: add ignored module

* chore: add files

* fix: type issue in utils

* fix: update all e2e tests

* chore: renaming

* chore: fix and simplify go-to logic

* chore: fix lint and unit tests

* chore: fix e2e for new goto

* chore: fix scripts to support respect-core

* fix parser:generate

* chore: rename ResultObject type

* chore: remove todos

* chore: sync package-lock

* chore: fix some lint errors

* chore: add secret

* chore: prettier fix

* chore: add abnf-parser to prettierignore

* chore: publish respect-core snaphot to npm

* chore: comment ignored e2e snapshot and update regexp

* fix: update cert regexp

* chore: try fixing publish and yarn smokes

* chore: try fixing publish

* chore: try fixing publish and remove smokes for node 14 and 16

* chore: fix docker smoke test

* chore: improve README and CONTRIBUTING files

* fix: cookies from workflows and step are not set to the request (#1918)

* chore: update respect command handler (#1920)

* fix: the $file decorator resolves wrong path to the file (#1921)

* chore: improve performance (#1924)

* fix: kebab case command options & mtls path & remove residensy (#1925)

* chore: cleanup resources folder (#1926)

* fix: revert dynamic imports

* chore: add dynamic import back

* chore: rename workflowId to workflowName and also targetWorkflow (#1927)

* chore: rename workflowId to workflowName and also targetWorkflow

* chore: fix tests and move outputs calc lower

* chore: run prettier

* Update packages/respect-core/src/modules/flow-runner/call-api-and-analyze-results.ts

Co-authored-by: Andrew Tatomyr <[email protected]>

---------

Co-authored-by: Andrew Tatomyr <[email protected]>

* chore: update package lock (#1929)

* feat: remove extendend option from generate-arazzo command (#1930)

* chore: fix e2e snapshots escape seq

* chore: simplify nested workflows output and flow

* chore: verbose flag was lost for nested workflows (#1934)

* chore: refactor types, descriptions and names (#1932)

* chore: improve tests (#1935)

* feat: resolve server url (#1936)

* chore: implement new json output and improve counting of steps

* chore: use json server test (#1937)

* chore: improve performance (#1941)

* feat: changes to success criteria checks display (#1943)

* feat: changes to success criteria checks display

* chore: update smoke snapshot

* chore: make check display function

* chore: update name

* chore: update smoke

* chore: update smoke again

---------

Co-authored-by: Roman Hotsiy <[email protected]>

* chore: fix default failure action

* chore: adjust license and readme

* chore: rename cli rules (#1946)

* chore: implement respect_max_steps (#1945)

* chore: implement respect_max_steps

* chore: remove recors from fake-db

* chore: fix git ignore

* chore: update e2e snapshot

* chore: fix json logs

* chore: fix types

---------

Co-authored-by: DmitryAnansky <[email protected]>

* chore: fix body always present

* chore: change max steps to 2000

* chore: rename env var

* chore: fix prettier

* chore: fix unknown step + tests

* chrore: fix json output data

---------

Co-authored-by: DmitryAnansky <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
Co-authored-by: Andrew Tatomyr <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
DmitryAnansky added a commit that referenced this pull request Feb 25, 2025
* feat: add respect to cli

* chore: prettier

* chore: changes to e2e and rename to respect-core

* feat: remove respect auth

* fix: add ignored module

* chore: add files

* fix: type issue in utils

* fix: update all e2e tests

* chore: renaming

* chore: fix and simplify go-to logic

* chore: fix lint and unit tests

* chore: fix e2e for new goto

* chore: fix scripts to support respect-core

* fix parser:generate

* chore: rename ResultObject type

* chore: remove todos

* chore: sync package-lock

* chore: fix some lint errors

* chore: add secret

* chore: prettier fix

* chore: add abnf-parser to prettierignore

* chore: publish respect-core snaphot to npm

* chore: comment ignored e2e snapshot and update regexp

* fix: update cert regexp

* chore: try fixing publish and yarn smokes

* chore: try fixing publish

* chore: try fixing publish and remove smokes for node 14 and 16

* chore: fix docker smoke test

* chore: improve README and CONTRIBUTING files

* fix: cookies from workflows and step are not set to the request (#1918)

* chore: update respect command handler (#1920)

* fix: the $file decorator resolves wrong path to the file (#1921)

* chore: improve performance (#1924)

* fix: kebab case command options & mtls path & remove residensy (#1925)

* chore: cleanup resources folder (#1926)

* fix: revert dynamic imports

* chore: add dynamic import back

* chore: rename workflowId to workflowName and also targetWorkflow (#1927)

* chore: rename workflowId to workflowName and also targetWorkflow

* chore: fix tests and move outputs calc lower

* chore: run prettier

* Update packages/respect-core/src/modules/flow-runner/call-api-and-analyze-results.ts

Co-authored-by: Andrew Tatomyr <[email protected]>

---------

Co-authored-by: Andrew Tatomyr <[email protected]>

* chore: update package lock (#1929)

* feat: remove extendend option from generate-arazzo command (#1930)

* chore: fix e2e snapshots escape seq

* chore: simplify nested workflows output and flow

* chore: verbose flag was lost for nested workflows (#1934)

* chore: refactor types, descriptions and names (#1932)

* chore: improve tests (#1935)

* feat: resolve server url (#1936)

* chore: implement new json output and improve counting of steps

* chore: use json server test (#1937)

* chore: improve performance (#1941)

* feat: changes to success criteria checks display (#1943)

* feat: changes to success criteria checks display

* chore: update smoke snapshot

* chore: make check display function

* chore: update name

* chore: update smoke

* chore: update smoke again

---------

Co-authored-by: Roman Hotsiy <[email protected]>

* chore: fix default failure action

* chore: adjust license and readme

* chore: rename cli rules (#1946)

* chore: implement respect_max_steps (#1945)

* chore: implement respect_max_steps

* chore: remove recors from fake-db

* chore: fix git ignore

* chore: update e2e snapshot

* chore: fix json logs

* chore: fix types

---------

Co-authored-by: DmitryAnansky <[email protected]>

* chore: fix body always present

* chore: change max steps to 2000

* chore: rename env var

* chore: fix prettier

* chore: fix unknown step + tests

* chrore: fix json output data

* chore: remove skipped column in workflow result table (#1948)

* fix: server selection by index (#1949)

* chore: fix json output types

* fix: replacement value evaluation (#1950)

* fix: revert warning level test

---------

Co-authored-by: DmitryAnansky <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
Co-authored-by: Andrew Tatomyr <[email protected]>
Co-authored-by: Roman Hotsiy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants