@Test(description = "it should deserialize a read only parameter") public void deserializeReadOnlyParameter() throws IOException { final String json = "{\"in\":\"path\"," + "\"content\":{" + " \"*/*\":{" + " \"schema\":{" + " \"type\":\"string\"," + " \"readOnly\":true}}}}"; final Parameter p = m.readValue(json, Parameter.class); assertTrue(p.getContent().get("*/*").getSchema().getReadOnly()); }
if (parameter.getContent() != null && parameter.getContent().values().size() > 0) { paramSchema = parameter.getContent().values().iterator().next().getSchema();
for (Parameter parameter : pathItem.getParameters()) { addSchemaRef(parameter.getSchema(), referencedDefinitions); addContentSchemaRef(parameter.getContent(), referencedDefinitions); for (Parameter parameter : op.getParameters()) { addSchemaRef(parameter.getSchema(), referencedDefinitions); addContentSchemaRef(parameter.getContent(), referencedDefinitions);
protected void updateLocalRefs(Parameter param, String pathRef) { if(param.getSchema() != null) { updateLocalRefs(param.getSchema(), pathRef); } if(param.getContent() != null) { Map<String, MediaType> content = param.getContent(); for (String key: content.keySet()) { MediaType mediaType = content.get(key); if (mediaType.getSchema() != null) { updateLocalRefs(mediaType.getSchema(), pathRef); } } } }
protected void updateLocalRefs(Parameter param, String pathRef) { if(param.getSchema() != null) { updateLocalRefs(param.getSchema(), pathRef); } if(param.getContent() != null) { Map<String, MediaType> content = param.getContent(); for (String key: content.keySet()) { MediaType mediaType = content.get(key); if (mediaType.getSchema() != null) { updateLocalRefs(mediaType.getSchema(), pathRef); } } } }
protected void updateLocalRefs(Parameter param, String pathRef) { if(param.getSchema() != null) { updateLocalRefs(param.getSchema(), pathRef); } if(param.getContent() != null) { Map<String, MediaType> content = param.getContent(); for (String key: content.keySet()) { MediaType mediaType = content.get(key); if (mediaType.getSchema() != null) { updateLocalRefs(mediaType.getSchema(), pathRef); } } } }
if(parameter.getContent() != null) { Map<String,MediaType> content = parameter.getContent(); for( String mediaName : content.keySet()) { MediaType mediaType = content.get(mediaName);
if(parameter.getContent() != null) { Map<String,MediaType> content = parameter.getContent(); for( String mediaName : content.keySet()) { MediaType mediaType = content.get(mediaName);
if(parameter.getContent() != null) { Map<String,MediaType> content = parameter.getContent(); for( String mediaName : content.keySet()) { MediaType mediaType = content.get(mediaName);
if (parameter.getContent() != null && parameter.getContent().values().size() > 0) { paramSchema = parameter.getContent().values().iterator().next().getSchema();
if(parameter.getContent() != null){ Map<String,MediaType> content = parameter.getContent(); for (String key: content.keySet()){ if (content.get(key) != null && content.get(key).getSchema() != null ){
if(parameter.getContent() != null){ Map<String,MediaType> content = parameter.getContent(); for (String key: content.keySet()){ if (content.get(key) != null && content.get(key).getSchema() != null ){
if(parameter.getContent() != null){ Map<String,MediaType> content = parameter.getContent(); for (String key: content.keySet()){ if (content.get(key) != null && content.get(key).getSchema() != null ){
for (Parameter parameter : pathItem.getParameters()) { addSchemaRef(parameter.getSchema(), referencedDefinitions); addContentSchemaRef(parameter.getContent(), referencedDefinitions); for (Parameter parameter : op.getParameters()) { addSchemaRef(parameter.getSchema(), referencedDefinitions); addContentSchemaRef(parameter.getContent(), referencedDefinitions);
openApiDiff .getContentDiff() .diff(left.getContent(), right.getContent(), context) .ifPresent(changedParameter::setContent); openApiDiff
@Override public BallerinaParameter buildContext(Parameter parameter, OpenAPI openAPI) throws BallerinaOpenApiException { this.name = parameter.getName(); this.in = parameter.getIn(); this.description = parameter.getDescription(); this.required = parameter.getRequired(); this.deprecated = parameter.getDeprecated(); this.allowEmptyValue = parameter.getAllowEmptyValue(); this.ref = parameter.get$ref(); this.style = parameter.getStyle(); this.explode = parameter.getExplode(); this.allowReserved = parameter.getAllowReserved(); this.examples = parameter.getExamples(); this.example = parameter.getExample(); this.content = parameter.getContent(); this.extensions = parameter.getExtensions(); this.schema = new BallerinaSchema().buildContext(parameter.getSchema(), openAPI); return this; }