-
-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Labels
Description
For example, you have your openapi spec:
paths:
/users/{userId}:
get:
summary: Get a user by ID
parameters: ...
responses:
"200":
description: A single user.
content:
application/json:
schema:
$ref: "#/components/schemas/User"
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: stringInstead of specifying
request:
url: http://example.com/users/123
response:
json:
id: 123
name: !anystryou could point to a component in an openapi schema and say that the response schema just has to match it. 'required' fields would be automatically replaced with a !anyint !anystr if possible to infer?
request:
url: http://example.com/users/123
response:
with_openapi:
path: /path/to/schema.json
schema: "#/components/schemas/User"
json:
id: 123This would be more useful for massive responses
grpc already implicitly does this as it requires a certain type to reflect into (but doesn't check 'required' fields as they don't exist in proto3).
Reactions are currently unavailable