elements icon indicating copy to clipboard operation
elements copied to clipboard

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

Open kentbulza opened this issue 4 months ago • 8 comments

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.

kentbulza avatar Feb 18 '24 01:02 kentbulza

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

github-actions[bot] avatar Feb 23 '24 17:02 github-actions[bot]

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.

kentbulza avatar Mar 30 '24 23:03 kentbulza

@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

weyert avatar Apr 24 '24 17:04 weyert

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: @.***>

kentbulza avatar Apr 24 '24 17:04 kentbulza

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

weyert avatar Apr 24 '24 17:04 weyert

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: @.***>

kentbulza avatar Apr 24 '24 17:04 kentbulza

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

weyert avatar Apr 24 '24 22:04 weyert

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

weyert avatar Apr 25 '24 13:04 weyert