swagger-api / swagger-parser

Swagger Spec to Java POJOs
http://swagger.io
Apache License 2.0
773 stars 526 forks source link

SWG-9288 utilizing safe url resolver for OAS 2.0 #2031

Closed MiloszTarka closed 5 months ago

MiloszTarka commented 6 months ago

Addresses: https://github.com/swagger-api/swagger-parser/issues/2030

This PR makes swagger-parser to utilizes safeUrlResolver when resolving OpenAPI 2.0 definitions.

The reason behind this change is described deeply under the following PR: https://github.com/swagger-api/swagger-parser/pull/1910

The $refs are checked in ResolverCache class, in loadRef method.

In order to keep the backward compatibility, I've created a new constructor of ResolverCache so it is possible to explicitly pass the parseOptions through the SwaggerResolver.

MiloszTarka commented 6 months ago

I'll add tests soon & similar PR to v3 parser

MiloszTarka commented 6 months ago

Great work, just 2 possible changes in constructors

Great shout, commited changes! Sorry for taking so long to apply the feedback, had to urgently finish other stuff last days.