knuckleswtf / knuckleswtf/scribe

Using @apiResource as a @bodyParam?

Open
#851 1 comment 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
PHP
Stars
2.3k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

### Scribe version

4.31.0

### Your question

It would be helpful as most API's actually leverage the exact model for inputs to be able to do something like:

`@bodyParam [] App\Model\MyModel with=... omits=some_field,with_relation.field`

It doesn't currently appear that this is possible but rather it's recommended to always use Form handlers but this would be a nice feature especially for quick building of the spec docs.

### Docs

- [X] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution

Contributor guide

Open the contributing guide

Research direction

Start by tracing how @apiResource and @bodyParam annotations are currently handled, then review the existing Form handler recommendation. Define how a model, with= relations, and omits= fields should be interpreted, and verify the generated API documentation covers the requested input structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.