Describe the bug
JSON pointers must use %7B and %7D to represent brackets for correct functionality in the Spectral CLI and SDK. However, the VSCode extension does not handle this encoding properly. Instead, it only recognizes literal bracket characters, which is incorrect.
To Reproduce
Given this example OpenAPI document:
openapi: 3.0.3
info:
title: Swagger Petstore - OpenAPI 3.0
description: test
contact:
email: test@test.com
version: 1.0.11
servers:
- url: https://petstore3.swagger.io/api/v3
paths:
/pet/{petId}/test:
get:
summary: Find pet by ID
description: Returns a single pet
operationId: getPetById
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
responses:
'200':
description: test
Run the document through both the CLI and the VSCode extension. You will see an operation-tags warning.
Use this .spectral file:
extends: spectral:oas
overrides:
- files:
- "**#/paths/~1pet~1%7BpetId%7D~1test"
rules:
operation-tags: off
Notice the warning will not appear within the CLI, but will be present within the VSCode extension.
Use this .spectral file:
extends: spectral:oas
overrides:
- files:
- "**#/paths/~1pet~1{petId}~1test"
rules:
operation-tags: off
Notice the warning will not appear in the VSCode extension but will be present within the CLI.
Expected behavior
The VSCode extension should correctly parse %7B and %7D representations of brackets, ensuring no warnings appear when using the first .spectral file.
Screenshots
No Errors with literal bracket characters:
Errors with %7B and %7D encoding of bracket characters:
Describe the bug JSON pointers must use %7B and %7D to represent brackets for correct functionality in the Spectral CLI and SDK. However, the VSCode extension does not handle this encoding properly. Instead, it only recognizes literal bracket characters, which is incorrect.
To Reproduce
Given this example OpenAPI document:
Run the document through both the CLI and the VSCode extension. You will see an operation-tags warning.
Use this .spectral file:
Use this .spectral file:
Expected behavior The VSCode extension should correctly parse %7B and %7D representations of brackets, ensuring no warnings appear when using the first .spectral file. Screenshots No Errors with literal bracket characters: Errors with %7B and %7D encoding of bracket characters:
Environment: