ruby-grape / ruby-grape/grape-swagger

Support "additionalProperties" on Object types

Open
#690 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discuss! question
Dominant language
Ruby
Stars
1.1k
Forks
479
Avg merge
2d 14h
Merged PRs (30d)
6

Description

I'm not sure if OAS2 has this, I'd guess it does, but right now I'm looking for a way to support "freeform" objects being passed in.

For example, I have the option to pass in labels for my API:

# request payload
{ "labels": { "this":"is freeform", "no":"structure"}}

The labels key can have any type of keys/values passed into it. I'm looking for a way to document this using this gem. You can see this documented on Swagger here: https://swagger.io/docs/specification/data-models/data-types/#object (granted this is OAS3)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the gem's object-schema handling and compare its OAS2 behavior with the linked Swagger data-model guidance; determine how arbitrary keys and values should be represented. Done means the labels example can be documented as a freeform object.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.