public String computeType(final RequestBody bodyParam) { MediaType _head = IterableExtensions.<MediaType>head(bodyParam.getContentMediaTypes().values()); Schema _schema = null; if (_head!=null) { _schema=_head.getSchema(); } final Schema schema = _schema; if ((schema == null)) { return OpenApi3DiagramTypes.UNRESOLVED; } return this.schemaLabel("Request", schema); }
public String getResponseType(final Response response) { MediaType _head = IterableExtensions.<MediaType>head(response.getContentMediaTypes().values()); Schema _schema = null; if (_head!=null) { _schema=_head.getSchema(); } final Schema schema = _schema; return this.typesProvider.propertyTypeLabel("Response", schema); }
void checkEncodingPropsAreProps(MediaType mediaType, ValidationResults results) { // TODO Q: do allOf, anyOf, oneOf schemas participate? what about // additionalProperties? Schema schema = mediaType.getSchema(false); if (Overlay.of(schema).isElaborated()) { Set<String> propNames = schema.getProperties().keySet(); Map<String, EncodingProperty> encProps = mediaType.getEncodingProperties(); for (String encodingPropertyName : encProps.keySet()) { if (!propNames.contains(encodingPropertyName)) { results.addError(msg(EncPropNotSchemaProp, encodingPropertyName), Overlay.of(encProps, encodingPropertyName)); } } } }
void checkEncodingPropsAreProps(MediaType mediaType, ValidationResults results) { // TODO Q: do allOf, anyOf, oneOf schemas participate? what about // additionalProperties? Schema schema = mediaType.getSchema(false); if (Overlay.of(schema).isElaborated()) { Set<String> propNames = schema.getProperties().keySet(); Map<String, EncodingProperty> encProps = mediaType.getEncodingProperties(); for (String encodingPropertyName : encProps.keySet()) { if (!propNames.contains(encodingPropertyName)) { results.addError(msg(EncPropNotSchemaProp, encodingPropertyName), Overlay.of(encProps, encodingPropertyName)); } } } }
values.put(k, operation.getRequestBody().getContentMediaTypes().get(k).getSchema()); }; IterableExtensions.<String>take(operation.getRequestBody().getContentMediaTypes().keySet(), 1).forEach(_function);