Skip to content

URL-encoding for operationRef #1677

@Alan-Cha

Description

@Alan-Cha

I was under the impression that operationRef does not need URL-encoding.

For example, in the following snippit taken directly from the link object documentation...

links:
  UserRepositories:
    # returns array of '#/components/schemas/repository'
    operationRef: '#/paths/~12.0~1repositories~1{username}/get'
    parameters:
      username: $response.body#/username

... { and } are not encoded, i.e. replaced with %7B and %7D, like in the following:

links:
  UserRepositories:
    # returns array of '#/components/schemas/repository'
    operationRef: '#/paths/~12.0~1repositories~1%7Busername%7D/get'
    parameters:
      username: $response.body#/username

However, after talking to a developer of an OAS validator, I am doubtful... I was told that because operationRef is defined as a reference in the OAS, it needs URL-encoding.

Here is the link to the discussion. The last two exchanges are most important to this topic.

Could you clarify if operationRef needs URL-encoding?

Metadata

Metadata

Assignees

Labels

bugexamplesrequests for more or better examples in the specification

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions