Class ResolverCache

java.lang.Object
io.swagger.v3.parser.ResolverCache

public class ResolverCache extends Object
A class that caches values that have been loaded so we don't have to repeat expensive operations like: 1) reading a remote URL with authorization (e.g. using RemoteURL.java) 2) reading the contents of a file into memory 3) extracting a sub object from a json/yaml tree 4) de-serializing json strings into objects
  • Field Details

    • openapi31

      protected boolean openapi31
  • Constructor Details

    • ResolverCache

      public ResolverCache(io.swagger.v3.oas.models.OpenAPI openApi, List<io.swagger.v3.parser.core.models.AuthorizationValue> auths, String parentFileLocation)
    • ResolverCache

      public ResolverCache(io.swagger.v3.oas.models.OpenAPI openApi, List<io.swagger.v3.parser.core.models.AuthorizationValue> auths, String parentFileLocation, Set<String> resolveValidationMessages)
    • ResolverCache

      public ResolverCache(io.swagger.v3.oas.models.OpenAPI openApi, List<io.swagger.v3.parser.core.models.AuthorizationValue> auths, String parentFileLocation, Set<String> resolveValidationMessages, io.swagger.v3.parser.core.models.ParseOptions parseOptions)
  • Method Details

    • loadRef

      public <T> T loadRef(String ref, RefFormat refFormat, Class<T> expectedType)
    • updateLocalRefs

      protected <T> void updateLocalRefs(String file, T result)
    • updateLocalRefs

      protected <T> void updateLocalRefs(String file, io.swagger.v3.oas.models.media.Schema schema)
    • merge

      protected String merge(String host, String ref)
    • checkUrlIsPermitted

      protected void checkUrlIsPermitted(String refSet)
    • hasReferencedKey

      public boolean hasReferencedKey(String modelKey)
    • addReferencedKey

      public void addReferencedKey(String modelKey)
    • getRenamedRef

      public String getRenamedRef(String originalRef)
    • putRenamedRef

      public void putRenamedRef(String originalRef, String newRef)
    • getResolutionCache

      public Map<String,Object> getResolutionCache()
    • getExternalFileCache

      public Map<String,String> getExternalFileCache()
    • getRenameCache

      public Map<String,String> getRenameCache()
    • getParseOptions

      public io.swagger.v3.parser.core.models.ParseOptions getParseOptions()