All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.swagger.parser.processors.ResponseProcessor Maven / Gradle / Ivy

There is a newer version: 2.0.0-rc1
Show newest version
package io.swagger.parser.processors;

import io.swagger.models.Response;
import io.swagger.models.Swagger;
import io.swagger.models.properties.Property;
import io.swagger.parser.ResolverCache;

public class ResponseProcessor {

    private final PropertyProcessor propertyProcessor;

    public ResponseProcessor(ResolverCache cache, Swagger swagger) {
        propertyProcessor = new PropertyProcessor(cache, swagger);
    }

    public void processResponse(Response response) {
        //process the response body
        final Property schema = response.getSchema();

        if (schema != null) {
            propertyProcessor.processProperty(schema);
        }

        /* intentionally ignoring the response headers, even those these were modelled as a
         Map they should never have a $ref because what does it mean to have a
         complex object in an HTTP header?
          */

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy