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

com.reprezen.genflow.openapi3.doc.ParameterHelper Maven / Gradle / Ivy

package com.reprezen.genflow.openapi3.doc;

import com.reprezen.genflow.openapi3.doc.Helper;
import com.reprezen.jsonoverlay.Overlay;
import com.reprezen.kaizen.oasparser.model3.Parameter;

@SuppressWarnings("all")
public class ParameterHelper implements Helper {
  @Override
  public void init() {
  }
  
  /**
   * See comments at top of PropertyHelper - everything here is analogous
   */
  public Object getAttribute(final Parameter param, final String attr) {
    Object _switchResult = null;
    if (attr != null) {
      switch (attr) {
        case "description":
          _switchResult = param.getDescription();
          break;
        case "in":
          _switchResult = param.getIn();
          break;
        case "name":
          _switchResult = param.getName();
          break;
        case "required":
          boolean _isPresent = Overlay.of(param).isPresent();
          _switchResult = Boolean.valueOf((!_isPresent));
          break;
        case "type":
          _switchResult = param.getSchema().getType();
          break;
      }
    }
    return _switchResult;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy