Search in sources :

Example 1 with SingleValueParameterParser

use of io.vertx.ext.web.validation.impl.parameter.SingleValueParameterParser in project vertx-web by vert-x3.

the class JsonParameterProcessorGenerator method generate.

@Override
public ParameterProcessor generate(JsonObject parameter, JsonObject fakeSchema, JsonPointer parameterPointer, ParameterLocation parsedLocation, String parsedStyle, GeneratorContext context) {
    JsonObject originalSchema = (JsonObject) SCHEMA_POINTER.queryJsonOrDefault(parameter, new JsonObject());
    SchemaHolder schemas = context.getSchemaHolder(originalSchema, context.fakeSchema(fakeSchema), parameterPointer.copy().append("content").append("application/json").append("schema"));
    return new ParameterProcessorImpl(parameter.getString("name"), parsedLocation, !parameter.getBoolean("required", false), new SingleValueParameterParser(parsedLocation.lowerCaseIfNeeded(parameter.getString("name")), ValueParser.JSON_PARSER), schemas.getValidator());
}
Also used : SingleValueParameterParser(io.vertx.ext.web.validation.impl.parameter.SingleValueParameterParser) JsonObject(io.vertx.core.json.JsonObject) ParameterProcessorImpl(io.vertx.ext.web.validation.impl.parameter.ParameterProcessorImpl)

Aggregations

JsonObject (io.vertx.core.json.JsonObject)1 ParameterProcessorImpl (io.vertx.ext.web.validation.impl.parameter.ParameterProcessorImpl)1 SingleValueParameterParser (io.vertx.ext.web.validation.impl.parameter.SingleValueParameterParser)1