code: @Override
      public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
  
          // Only handle swagger requests
          String path = requestContext.getUriInfo().getPath();
          if (!"swagger.json".equals(path) && !"swagger.yaml".equals(path) && !"swagger".equals(path)) {
              return;
          }
  
          // CORS requests must have an Origin header
          String origin = requestContext.getHeaderString(HEADER_ORIGIN);
          if (origin == null) {
              return;
          }
  
          // Always add CORS allow origin header
          responseContext.getHeaders().add(HEADER_ACCESS_CONTROL_ALLOW_ORIGIN, "*");
  
      }
docs: {@inheritDoc}