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

Strings with a format cannot be defined via a runtime expression #937

Closed
matthias-pichler opened this issue Jul 26, 2024 · 0 comments · Fixed by #938
Closed

Strings with a format cannot be defined via a runtime expression #937

matthias-pichler opened this issue Jul 26, 2024 · 0 comments · Fixed by #938

Comments

@matthias-pichler
Copy link
Collaborator

What seems off:

I wanted to define the following workflow:

# yaml-language-server: $schema=https://serverlessworkflow.io/schemas/1.0.0-alpha2/workflow.yaml
document:
  dsl: 1.0.0-alpha2
  namespace: examples
  name: star-wars-homeplanet
  version: 1.0.0-alpha2
input:
  schema:
    format: json
    document:
      type: object
      required:
        - id
      properties:
        id:
          type: integer
          description: The id of the star wars character to get
          minimum: 1
do:
  - getStarWarsCharacter:
      call: http
      with:
        method: get
        endpoint: https://swapi.dev/api/people/{id}
        output: response
      export:
        as:
          homeworld: ${ .content.homeworld }
  - getStarWarsHomeworld:
      call: http
      with:
        method: get
        endpoint: ${ $context.homeworld }

to fetch a character from the star wars api and then their homeworld.

Unfortunately the definition does not pass the schema validation because:

Message: String '${ $context.homeworld }' does not validate against format 'uri-template'.
Schema path: https://serverlessworkflow.io/schemas/1.0.0-alpha2/workflow.yaml#/$defs/callTask/oneOf/2/properties/with/properties/endpoint/oneOf/1/format

What you expected to be:

the the endpoint can be specified as a runtime expression

Anything else we need to know?:

Environment:

  • Specification version used: 1.0.0-alpha2
@cdavernas cdavernas changed the title strings with a format cannot be defined via a runtime expression Strings with a format cannot be defined via a runtime expression Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant