stoplightio / elements

Build beautiful, interactive API Docs with embeddable React or Web Components, powered by OpenAPI and Markdown.
https://stoplight.io/open-source/elements/
Apache License 2.0
1.81k stars 205 forks source link

$.info.license.name Always Add Word "License" #2523

Closed kentbulza closed 3 months ago

kentbulza commented 9 months ago

Elements adds the word "License" to the end of the string contained in $.info.license.name. This make the assumption that every license is an Apache or MIT or something that would always be followed by the word "License", but it may be that the API uses another convention.

Context

Would like full control over the License string.

Current Behavior

Appends the word "License"

Possible Solution(s)

Simply remove the word "License". If someone wants to append the word "License", they can do so themselves.

github-actions[bot] commented 8 months ago

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-226) has been created.

kentbulza commented 7 months ago

I want to add some more comment to this. The text actually transforms into a URL to SPDX. This would be the correct behavior for the identifier, which indeed is a SPDX license, but it should not be the behavior for name.

weyert commented 6 months ago

@kentbulza Can you clarify what you are expecting? Some examples of what you expect to happen on the two scenarios identifier and name given then I will see if I solve it for you. Got some time from work to work on Elements issues we have ourselves

kentbulza commented 6 months ago

Certainly. The spec says EITHER identfier or URL is required. If it IS an identifier, then that would mean it is an SPDX identifier and then you are free have the link refer to SPDX. But if identifier is not there, then that means it's a custom URL (e.g. to a URL on your own website's description of the license).

In either case, the name (link text) should be simply the text one includes for the element. Important context is that SPDX does not have the concept of a commercial license. So for paid APIs that are "all rights reserved", the ability to describe the license fully by name is important.

As far as backward compatibility, it seems to me only something that has an identifier might be a candidate for unilaterally adding the word license. But I would think even that's a stretch -- I'm not sure why, absent words in the 3.1 spec, one should be adding any words.

On Wed, Apr 24, 2024, 10:07 AM Weyert de Boer @.***> wrote:

@kentbulza https://github.com/kentbulza Can you clarify what you are expecting? Some examples of what you expect to happen on the two scenarios identifier and name given then I will see if I solve it for you. Got some time from work to work on Elements issues we have ourselves

— Reply to this email directly, view it on GitHub https://github.com/stoplightio/elements/issues/2523#issuecomment-2075438142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3EL5U3MPGHA37TBCV2GIDY67RFPAVCNFSM6AAAAABDNXSB2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZVGQZTQMJUGI . You are receiving this because you were mentioned.Message ID: @.***>

weyert commented 6 months ago

Don't think we need to query the full name of the SPDX identifier license, right? Just the SPDX identifier itself?

kentbulza commented 6 months ago

I imagine the name alleviates the need to query anything? The identifier IS the path to the SPDX license. I assume you're thinking about displaying the identifier, but there's currently only a single page element. So if you're thinking aboit adding that, then seems to me it's a separate div???

On Wed, Apr 24, 2024, 10:25 AM Weyert de Boer @.***> wrote:

Don't think we need to query the full name of the SPDX identifier license, right? Just the SPDX identifier itself?

— Reply to this email directly, view it on GitHub https://github.com/stoplightio/elements/issues/2523#issuecomment-2075466549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ3EL5XLBUOYCP6UQ3VW773Y67TH7AVCNFSM6AAAAABDNXSB2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZVGQ3DMNJUHE . You are receiving this because you were mentioned.Message ID: @.***>

weyert commented 6 months ago

Ah that's true. I keep thinking identifier relates to name but it's identifier and/or url :)

weyert commented 6 months ago

@kentbulza Raised a PR, let me know if this is what you imagined