symfony / symfony-docs

The Symfony documentation
https://symfony.com/doc
Other
2.18k stars 5.12k forks source link

XML config points to invalid URLs for schema, messing up PHPStorm #18275

Open dkarlovi opened 1 year ago

dkarlovi commented 1 year ago

https://symfony.com/doc/current/serializer.html

Points to https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd which currently doesn't work (404).

<?xml version="1.0" encoding="UTF-8" ?>
<serializer xmlns="http://symfony.com/schema/dic/serializer-mapping"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/serializer-mapping
        https://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"
>
    <class name="App\Model\Person">
        <attribute name="createdAt">
            <context>
                <entry name="datetime_format">Y-m-d</entry>
            </context>
        </attribute>
    </class>
</serializer>

The URLs are not versioned so using them like this is probably suboptimal, @stof also pointed out in Slack this URL is not used at all (by Symfony) so it could also be pointed to the local filesystem.

options:

1.version the URLs, upload missing files, update the docs to use the new URLs

  1. fix the docs to point to local file system instead

Optionally, XML config examples in docs should be validated against the schema so we know they're correct, here's an example from the same URL which seems invalid:

<!-- config/packages/framework.xml -->
<framework:config>
    <!-- ... -->
    <framework:serializer>
        <!-- needs framework: prefix? -->
        <default-context enable-max-depth="true" yaml-indentation="2"/>
    </framework:serializer>
</framework:config>
alexandre-daubois commented 1 year ago

I guess this may be an issue to address to the code repo :thinking: The schema URLs should not point to local filesystem so this may be something to update on the code side

dkarlovi commented 1 year ago

Not sure I understand what you mean exactly @alexandre-daubois, the problem is in the docs and/or website, not the code itself (AFAIK).

javiereguiluz commented 1 year ago

Note that we've discussed internally about this in the Core Team. We still haven't reached a definitive agreement about how to properly fix this issue. Sorry.

dkarlovi commented 1 year ago

@javiereguiluz no rush from my end, this is more a FYI thing. :+1:

carsonbot commented 4 weeks ago

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot commented 2 weeks ago

Friendly ping? Should this still be open? I will close if I don't hear anything.

carsonbot commented 8 hours ago

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!