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

fix: payload schema reference resolution #94

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Conversation

VisualBean
Copy link
Contributor

@VisualBean VisualBean commented Feb 22, 2023

About the PR

Dependency resolution is now enforced during writing depending on the writer settings.
Before you had to specifically call "ResolveReferences()".

This enables a slightly easier usecase, where you can create an object model of references, and still get a document out that matches the writer settings.

Payload has been added as a "Reference" type, as it should have been all along.

Payload sub references, now resolve correctly as well.

Using default setting (ReferenceInlineSetting.DoNotInlineReferences)
will yield the following output

channels:
  mychannel:
    publish:
      message:
        payload:
          type: object
          required:
            - testB
          properties:
            testC:
              $ref: '#/components/schemas/testC'
            testB:
              $ref: '#/components/schemas/testB'
components:
  schemas:
    testD:
      type: string
      format: uuid
    testC:
      type: object
      properties:
        testD:
          $ref: '#/components/schemas/testD'
    testB:
      type: boolean
      description: test

Where setting ReferenceInlineSetting.InlineReferences
Will now correctly resolve references from components

channels:
  mychannel:
    publish:
      message:
        payload:
          type: object
          required:
            - testB
          properties:
            testC:
              type: object
              properties:
                testD:
                  type: string
                  format: uuid
            testB:
              type: boolean
              description: test
components: { }

Changelog

  • Added Payload as reference type
  • Fixed Reference resolution for subreferences in payload
  • Forced dependency resolution depending on Writer settings.

Related Issues

Related to discussion #93

@VisualBean VisualBean merged commit 70d4c23 into main Feb 22, 2023
@VisualBean VisualBean deleted the alex/fixschemareferences branch February 22, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant