ruby-grape / ruby-grape/grape-swagger
Deeply nested objects
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
The model we use for our API is strongly nested, we are working in Vehicle Routing Optimization and define a complex model in a single request. There are multiple high level objects such as
Services (missions to perform within a route) and Points (coordinates or matrix reference)
Within those objects are others objects
an Activity for Services which have a mission to perform or Activities, if we have alternatives available to perform a delivery.
Points have a single object below, which is the location (lat/lon)
The model is correctly validated with grape and works like a charm at this purpose.
But the generation of the documentation through grape-swagger generate some incorrect types
Location should be an hash, but is displayed as an array of hash.
Skills related to Services are displayed as String and should be array of string
Activity is displayed as an array of hash, and should be a single hash.
Activities are correctly displayed as an array of hash.
Please see the related pull request which display the errors.
Has anyone any hints on how I could to solve it or by my side, or by contributing if the bug is confirmed ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Begin by reproducing the nested Vehicle Routing Optimization schema and comparing Grape validation with the documentation generated by grape-swagger. Done means the generated types match the stated model: Location and Activity are objects, while Skills and Activities use the intended array types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100