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

Fixing 1591: Adding support for object literals in additionalProperties #1613

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

blast-hardcheese
Copy link
Member

Partially resolves #1591

This is an initial pass, without modifying the deserializers.

What is supported as of this PR:

      properties:
        jwtTokensByRole:
          type: object
          additionalProperties:
            type: object
            properties:
              items:
                ...

The additionalProperties triggers emission of a Map[String, A] (eg: case class Bar(foo: Map[String, Bar.Baz])), as well as the nested definition for the Schema[_] literal at that position.


What needs to be done for full compliance with the spec (I've left a comment to this effect) is to introduce yet another intermediate class type that can hold the parameters that may come along with a MapSchema.

What still fails after this change:

      properties:
        jwtTokensByRole:
          type: object
          properties:  # Mixing `properties` and `additionalProperties` is still unsupported
            foo:
              type: string
          additionalProperties:
            type: object
            properties:
              items:
                ...

@blast-hardcheese blast-hardcheese added the enhancement Functionality that has never existed in guardrail label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Functionality that has never existed in guardrail
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with inline object within additionalProperties
1 participant