atlassian / atlassian/openapi-request-validator

[restassured] Request validation should not use encoded path parameters

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
14
Forks
5
PR merge metrics
No merged PRs in 30d

Description

When we attempt to use request schema validation for an operation that requires encoding of its path parameters schema validation always fails, regardless of the request validity.

### Expected behavior

A request with a valid path parameter requiring encoding (e.g. `aud:foo:api:dummyService1`) is considered to be valid for schema validation.

### Actual behavior

Given the path parameter mentioned earlier request schema validation always fails:

> ECMA 262 regex "^aud:foo:(api|api-internal):[a-zA-Z0-9]+$" does not match input string "aud%3Afoo%3Aapi%3AdummyService1"

### Cause

The issue lies in [RestAssuredRequest](https://github.com/atlassian/openapi-request-validator/blob/master/openapi-request-validator-restassured/src/main/java/com/atlassian/oai/validator/restassured/RestAssuredRequest.java#L86) as `originalRequest.getDerivedPath()` always returns the path with encoding applied

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.