Last active
June 2, 2020 14:05
-
-
Save ota42y/0870100c03444d39d78107a23de9f171 to your computer and use it in GitHub Desktop.
Bad case for this PR https://github.com/interagent/committee/pull/256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema_path = Rails.root.join("config/openapi.yaml").to_s | |
config.middleware.use Committee::Middleware::RequestValidation, | |
schema_path: schema_path, | |
params_key: 'action_dispatch.request.request_parameters' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
title: api-test | |
version: '1.0' | |
servers: | |
- url: 'http://localhost:3000' | |
paths: | |
/users: | |
post: | |
parameters: | |
- in: query | |
name: page | |
schema: | |
type: integer | |
requestBody: | |
content: | |
application/json: | |
schema: | |
type: object | |
required: | |
- registered_at | |
properties: | |
age: | |
type: integer | |
registered_at: | |
type: string | |
format: "date-time" | |
responses: | |
'204': | |
description: No Content | |
content: | |
application/json: | |
schema: | |
type: object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
skip_before_action :verify_authenticity_token | |
def create | |
binding.pry | |
registered_at = params[:registered_at] | |
raise "error" unless registered_at < Time.now | |
user = ["debug user1"] # do something | |
head :ok | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment