public OperationProcessor(ResolverCache cache, Swagger swagger) { this.cache = cache; parameterProcessor = new ParameterProcessor(cache, swagger); responseProcessor = new ResponseProcessor(cache, swagger); }
public PathsProcessor(ResolverCache cache, Swagger swagger, SwaggerResolver.Settings settings) { this.swagger = swagger; this.cache = cache; this.settings = settings; parameterProcessor = new ParameterProcessor(cache, swagger); operationProcessor = new OperationProcessor(cache, swagger); }
public ResponseProcessor(ResolverCache cache, Swagger swagger) { modelProcessor = new ModelProcessor(cache, swagger); externalRefProcessor = new ExternalRefProcessor(cache, swagger); }
public void processProperty(Property property) { if (property instanceof RefProperty) { processRefProperty((RefProperty) property); } else if (property instanceof ArrayProperty) { processArrayProperty((ArrayProperty) property); } else if (property instanceof MapProperty) { processMapProperty((MapProperty) property); } else if (property instanceof ObjectProperty) { processObjectProperty((ObjectProperty) property); } else if (property instanceof ComposedProperty) { processComposedProperty((ComposedProperty) property); } }
public void processModel(Model model) { if (model == null) { return; } if (model instanceof RefModel) { processRefModel((RefModel) model); } else if (model instanceof ArrayModel) { processArrayModel((ArrayModel) model); } else if (model instanceof ComposedModel) { processComposedModel((ComposedModel) model); } else if (model instanceof ModelImpl) { processModelImpl((ModelImpl) model); } }
public SwaggerResolver(Swagger swagger, List<AuthorizationValue> auths, String parentFileLocation, Settings settings) { this.swagger = swagger; this.settings = settings != null ? settings : new Settings(); this.cache = new ResolverCache(swagger, auths, parentFileLocation); definitionsProcessor = new DefinitionsProcessor(cache, swagger); pathProcessor = new PathsProcessor(cache, swagger, this.settings); operationsProcessor = new OperationProcessor(cache, swagger); }
public ModelProcessor(ResolverCache cache, Swagger swagger) { this.propertyProcessor = new PropertyProcessor(cache, swagger); this.externalRefProcessor = new ExternalRefProcessor(cache, swagger); }
from(properties.getProperty("source")) .process(new ResponseProcessor()) .inOnly("direct:z") .end(); from("direct:z") .unmarshal() .jaxb("com.example.entities.xml").convertBodyTo(Entity.class) .multicast() .to("direct:x") .end(); from("direct:x").transacted() .process((ContentEnricherProcessor) applicationContext.getBean("contentEnricherProcessor")) .to(properties.getProperty("activemq.destination"));
public void processResponse(Response response) { //process the response body final Model schema = response.getResponseSchema(); if (response instanceof RefResponse) { RefResponse refResponse = (RefResponse) response; processReferenceResponse(refResponse); } if (schema != null) { modelProcessor.processModel(schema); } /* intentionally ignoring the response headers, even those these were modelled as a Map<String, Property> they should never have a $ref because what does it mean to have a complex object in an HTTP header? */ }
private void processComposedModel(ComposedModel composedModel) { processModel(composedModel.getParent()); processModel(composedModel.getChild()); final List<RefModel> interfaces = composedModel.getInterfaces(); if (interfaces != null) { for (RefModel model : interfaces) { processRefModel(model); } } }
protected void updateLocalRefs(Property property, String pathRef) { if(property instanceof RefProperty) { RefProperty ref = (RefProperty) property; if(isLocalRef(ref.get$ref())) { ref.set$ref(computeLocalRef(ref.get$ref(), pathRef)); }/*else if(isLocalRef(ref.getOriginalRef())) { ref.set$ref(computeLocalRef(ref.getOriginalRef(), pathRef)); }*/ } }
private void processMapProperty(MapProperty property) { final Property additionalProperties = property.getAdditionalProperties(); if (additionalProperties != null) { processProperty(additionalProperties); } }
public DefinitionsProcessor(ResolverCache cache, Swagger swagger) { this.cache = cache; this.swagger = swagger; modelProcessor = new ModelProcessor(cache, swagger); }
protected void updateLocalRefs(Parameter param, String pathRef) { if(param instanceof BodyParameter) { BodyParameter bp = (BodyParameter) param; if(bp.getSchema() != null) { updateLocalRefs(bp.getSchema(), pathRef); } } }
public PropertyProcessor(ResolverCache cache, Swagger swagger) { externalRefProcessor = new ExternalRefProcessor(cache, swagger); }
private void processProperties(final Map<String, Property> subProps, final String file) { if (subProps == null || subProps.isEmpty()) { return; } processProperties(subProps.values(), file); }
private void processComposedProperty(ComposedProperty property) { final List<Property> properties = property.getAllOf(); if (properties != null) for (Property p : properties) processProperty(p); } }
public ParameterProcessor(ResolverCache cache, Swagger swagger) { this.cache = cache; this.modelProcessor = new ModelProcessor(cache, swagger); }
protected void updateLocalRefs(Response response, String pathRef) { if(response.getResponseSchema() != null) { updateLocalRefs(response.getResponseSchema(), pathRef); } }
private void processArrayModel(ArrayModel arrayModel) { final Property items = arrayModel.getItems(); // ArrayModel has a properties map, but my reading of the swagger spec makes me think it should be ignored if (items != null) { propertyProcessor.processProperty(items); } }