Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StructuredOutput] Support description from @param #202

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Jan 24, 2025

Before, only @var was supported

@OskarStark OskarStark self-assigned this Jan 24, 2025
@OskarStark OskarStark changed the title Support descriptions from @param [StructuredOutput] Support description from @param Jan 24, 2025
@OskarStark
Copy link
Contributor Author

@chr-hertel this shows the problem, but I have no clue how to extract the description from @param 🤔

cc @DZunke

@chr-hertel
Copy link
Member

had a look and failed as well, and i guess that's because

a) the param tag belongs to methods

meaning it should look like

final class UserWithAtParamAnnotation
{
    /**
     * @param string $name The name of the user in lowercase
     */
    public function __construct(
        public int $id,
        public string $name,
        public \DateTimeInterface $createdAt,
        public bool $isActive,
        public ?int $age = null,
    ) {
    }
}

which leads to b) the property component doesn't care about method params from constructor, is that possible?

meaning those param infos are not extracted by Symfony's PropertyType component

@OskarStark
Copy link
Contributor Author

That is possible

@chr-hertel
Copy link
Member

chr-hertel commented Jan 29, 2025

so, after further investigation it doesn't even work with symfony/symfony#57632

so decouple from property-info and doing it ourselves would be the answer 😬
but i'm also not an expert when it comes to that component ofc

@OskarStark
Copy link
Contributor Author

Needs

@chr-hertel
Copy link
Member

would work with #212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants