knuckleswtf / knuckleswtf/scribe

Feature Request: Tagged union Request/Response types

Open
#965 2 comments 0 reactions 0 assignees View on GitHub
question triage
Dominant language
PHP
Stars
2.3k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

### Scribe version

5.1.0

### Your question

Would it be possible to consider the addition of tagged union Request and Response types?
As I've also discussed in https://github.com/laravel/framework/discussions/54880. this is currently a missing feature in laravel/framework validation rules, but I think it would be a good addition to Scribe in order to conform more to the [OpenAPI Spec](https://swagger.io/specification/v3/#discriminator-object)

> [!NOTE]
> I'll try to implement this when/if https://github.com/laravel/framework/pull/55191 gets merged
> If it gets rejected I'll still investigate the possibility of implementing this functionality anyway, albeit without 1:1 validation backing from laravel

### 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 reading the linked Laravel discussion and pull request 55191, then compare the requested behavior with the OpenAPI discriminator object specification. Review the Scribe Laravel documentation and existing issues to identify the relevant request and response generation entry points; done means tagged union types are represented in the generated API documentation with Laravel validation support where available.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, openapi, php
Domain
api, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.