0

I’m creating a simple HTTP GET event in the Godspeed framework. My goal is to accept a query parameter called name and return a response. However, when I define the event YAML with type: string directly inside the params, the server throws a validation error saying must have required property 'schema'. I expected this to work, but it seems godspeed' param framework uses a different format. What is the correct way to define query parameters in godspeed events so they pass validation?

http.get./greet:
  fn: greet_user
  params:
    - name: name
      in: query
      required: true
      type: string
  responses:
    200:
      content:
        application/json:
          schema:
            type: string

But when I run godspeed serve, the framework logs:

Event validation failed for http.get./greet
[ { instancePath: '/params/0', message: "must have required property 'schema'" } ]

It seems to reject my params block. Am I defining it wrong? How should query parameters be structured in Godspeed's Param framework ?

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 1 at 8:44

1 Answer 1

2

The error happens because godspeed's param framework validates all events against its internal schema, and for params it requires a schema object — not just type.
Your YAML should look like this:

http.get./greet:
  fn: greet_user
  authn: false
  params:
    - name: name
      in: query
      required: true
      schema:
        type: string
  responses:
    200:
      content:
        application/json:
          schema:
            type: string

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.