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

Update apigateway.md #12305

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

karinigishivakumar
Copy link

@karinigishivakumar karinigishivakumar commented Dec 20, 2023

errorMessage": "Expected schema to be an object or boolean", "errorType": "SchemaError", "offlineInfo": "If you believe this is an issue with serverless-offline please submit it, thanks. https://github.com/dherault/serverless-offline/issues", "stackTrace": [ "SchemaError: Expected schema to be an object or boolean", "at Validator.validate

I was getting above error due to below configuration of my yml file . due to serverless-offline update schemas is changed to schema but document is not upto date. So i have changed schemas to schema inside the function. provider:
...
apiGateway:
request:
schemas:
post-create-model:
name: PostCreateModel
schema: ${file(api_schema/post_add_schema.json)}
description: "A Model validation for adding posts"

functions:
create:
handler: posts.create
events:
- http: path: posts/create method: post request: schemas: application/json: post-create-model

Closes: #{ISSUE_NUMBER}

errorMessage": "Expected `schema` to be an object or boolean", "errorType": "SchemaError", "offlineInfo": "If you believe this is an issue with serverless-offline please submit it, thanks. https://github.com/dherault/serverless-offline/issues", "stackTrace": [ "SchemaError: Expected `schema` to be an object or boolean", "at Validator.validate
I was getting above error due to below configuration of my yml file . due to serverless-offline update schemas is changed to schema but  document is not upto date. So i have changed schemas to schema inside the function.
provider:
    ...
    apiGateway:
      request:
        schemas:
          post-create-model:
            name: PostCreateModel
            schema: ${file(api_schema/post_add_schema.json)}
            description: "A Model validation for adding posts"

functions:
  create:
    handler: posts.create
    events:
      - http:
          path: posts/create
          method: post
          request:
            schemas:
              application/json: post-create-model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant