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

feat(extensions): add support for different json body types (array or object) #324

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

reubenmiller
Copy link
Owner

@reubenmiller reubenmiller commented Dec 6, 2023

Support a new contentType in the extension definition to specify whether the json body should be an array or an object. This influences how the paths are interpreted in the parameter sections.

Two new types are supported under .commands[].bodyContent.type

  • jsonobject
  • jsonarray

These values have also been added to the json schema (to make it easier to consume.

Example command (snippet)

  - name: example
    path: inventory/managedObjects
    description: Create object
    method: POST
    bodyContent:
      type: jsonarray
    body:
      - name: name
        type: string
        property: 0.name
        description: property of an array

      - name: version
        type: string
        property: 0.version
        description: property of an array

@reubenmiller reubenmiller changed the title feat(extensions): add support for controlling the json body type, e.g. array or object feat(extensions): add support for different json body types (array or object) Dec 6, 2023
@reubenmiller reubenmiller merged commit 9706758 into v2 Dec 6, 2023
4 checks passed
@reubenmiller reubenmiller deleted the feat-support-json-array-body-in-extensions branch December 6, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant