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

Add array support to Swagger::Object and Swagger::Property #23

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

erdnaxeli
Copy link
Contributor

This adds the support of array objects, or array properties. It allows a user to do:

    builder.add(
      Swagger::Object.new(
        "SomethingList",
        "array",
        items: "Something",
      ),
    )

or:

    builder.add(
      Swagger::Object.new(
        "Post",
        "object",
        [
          Swagger::Property.new("id", "integer", "int32", example: 1),
          Swagger::Property.new("comments", "array", items: "Comment"),
        ]
      )
    )

I used refs here but items can also contains a Swagger::Object.

Tests to come.

@erdnaxeli erdnaxeli changed the title Add support for array to objects Add array support to Swagger::Object and Swagger::Property Feb 5, 2021
@erdnaxeli erdnaxeli marked this pull request as ready for review February 5, 2021 12:57
@erdnaxeli erdnaxeli mentioned this pull request Feb 5, 2021
@icyleaf icyleaf merged commit 7a828ad into icyleaf:master Mar 25, 2021
@icyleaf
Copy link
Owner

icyleaf commented Mar 25, 2021

Sorry about no response for a long time.

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.

2 participants