Skip to content

Correctly escape example operationRef URLs - #3731

Merged
miqui merged 1 commit into
OAI:v3.0.4-devfrom
handrews:curly-braces
Apr 25, 2024
Merged

Correctly escape example operationRef URLs#3731
miqui merged 1 commit into
OAI:v3.0.4-devfrom
handrews:curly-braces

Conversation

@handrews

Copy link
Copy Markdown
Member

It's ugly, but that's URL-encoding for you. If accepted, I will port this to 3.1.1 and 3.2.0.

@handrewshandrews added bug examples requests for more or better examples in the specification labels Apr 20, 2024
@handrewshandrews added this to the v3.0.4 milestone Apr 20, 2024
@handrews
handrews requested a review from a teamApril 20, 2024 23:22

@mikekistlermikekistler left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ... ahh ... ugly ... but correct. 👍

Comment threadversions/3.0.4.md
UserRepositories:
# returns array of '#/components/schemas/repository'
operationRef: '#/paths/~12.0~1repositories~1{username}/get'
operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment threadversions/3.0.4.md
UserRepositories:
# returns array of '#/components/schemas/repository'
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get
operationRef: https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1%7Busername%7D/get

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment threadversions/3.0.4.md

Note that in the use of `operationRef`, the _escaped forward-slash_ is necessary when
using JSON references.
using JSON Pointers, and it is necessary to URL-encode `{` and `}` as `%7B` and `%7D`, respectively when

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@karenetheridge

karenetheridge commented Apr 24, 2024

Copy link
Copy Markdown
Member

I'm not sure that this is needed now that we have the change from #3455 ?

Alternatively perhaps the operationRef format removal from that PR should be reverted.

@handrews

Copy link
Copy Markdown
MemberAuthor

@karenetheridge the schema is not normative and issue #1677 has TSC folks acknowledging that it needs URL-encoding.

So I guess we have to burn up Thursday meeting time on this after all? This is what is so frustrating about trying to move forward. We have such an immense backlog of minor things that they are all stepping on each other, and any attempt to resolve them runs into yet another contradiction or change in opinion.

@handrews

Copy link
Copy Markdown
MemberAuthor

The normative spec clearly states that operationRef is:

A relative or absolute URI reference to an OAS operation.

Not a template. So I think this change is correct and the schema change was wrong. If we want it to be an unencoded template we'd need to change the spec language.

@miqui
miqui merged commit 761f50f into OAI:v3.0.4-devApr 25, 2024
@handrews
handrews deleted the curly-braces branch April 25, 2024 19:26
lornajane added a commit that referenced this pull request May 1, 2024
Correctly escape example operationRef URLs (3.1.1 port of #3731)
lornajane added a commit that referenced this pull request May 1, 2024
Correctly escape example operationRef URLs (3.2.0 port of #3731)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugexamplesrequests for more or better examples in the specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@handrews@karenetheridge@ralfhandl@miqui@mikekistler