`additionalProperties` doesn't work properly with `$ref`
See original GitHub issueConsider the following:
openapi: 3.0.1
info:
title: Whatever
version: 1.0.0
paths:
/foo:
post:
operationId: getFoo
responses:
200:
content:
application/json:
schema:
$ref: '#/components/schemas/Foo'
components:
schemas:
Foo:
type: object
required:
- something
- props
properties:
something:
type: string
props:
type: object
additionalProperties:
type: integer
format: int32
FooProps:
type: object
additionalProperties:
type: integer
format: int32
FooNested:
type: object
required:
- something
- props
properties:
something:
type: string
props:
$ref: "#/components/schemas/FooProps"
Foo
comes out correct:
case class Foo(something: String, props: Map[String, Int])
However, I would expect FooNested
to look the same, but instead we get:
case class FooNested(something: String, props: io.circe.Json)
(And FooProps
isn’t emitted at all, as I guess we’d expect.)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
additionalProperties and $ref are not working together #185
I have a schema file (Thing.schema) which is referencing to another file (ID.schema). When I set inside of Thing.schema ...
Read more >how to use additionalProperties from a $ref file? - Stack Overflow
additionalProperties: false works by applying false (which is a valid schema, which returns failure to validate) to values which do not ...
Read more >"additionalProperties" and "allOf", here we go again!
talking about. ... So the end result is a schema where the data must be an object, and the "foo" property (if defined)...
Read more >Understanding JSON Schema
JSON Schema is a powerful tool for validating the structure of JSON data. However, learning to use it by reading its.
Read more >Additional Properties - Liquid Technologies
The value of "additionalProperties" MUST be a boolean or an object. ... For each regex in "pp", if it matches "m" successfully, the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah yeah, looks like you fixed it: https://github.com/twilio/guardrail/commit/364a06c12fd8925100f825365d77dc27e7b491ae
Yah, I’m working on a test now.