Open sNok3 opened 4 months ago
@sNok3 please share the example of your code and resulting docs. Also would be great to understand what your expected
class Driver extends Model
{
use HasFactory;
use HasStatuses;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
/**
* The internal ID of the associated route
*
* @var int
*
* @example 1
*/
'route_id',
/**
* The identifier of the activity
*
* @example 3d4b6f0e-2b0b-4b0b-8b4b-0b2b4b0b2b4b
*/
'identifier'
];
So as you can see, I have annotations for both fields here, but under the schemas, there are is no information about the model.
@sNok3 ooh, gotcha. So basically you want to annotate the model fields with descriptions and examples?
Currently this is not supported.
You can use API resources and there you can add the descriptions.
However, I'll keep this issue open to add this possibility in future.
Yeah, that is exactly what I needed. However, using API resources in the controller method isn't really my way to go for now since I have a big codebase.
However, I'll gladly wait for this to get implemented!
As the title suggests, when generating the docs for a controller which has model binding, the schema for the model will result in just the fields that the model has, without the annotations it has.