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

java.OpenAPIResponse.xpt Maven / Gradle / Ivy

There is a newer version: 1.24.1
Show newest version
«IMPORT uml»
«IMPORT JMM»
«EXTENSION java::OpenAPIFunctions»
«EXTENSION org::openarchitectureware::util::stdlib::io»

«DEFINE Responses(OpenAPI3Specification spec) FOR RESTOperation -»
    «REM»Resolve REST operation specific error responses«ENDREM-»
    «FOREACH this.clientDependency.supplier.typeSelect(OpenAPIResponse).sortBy(e|e.statusCodes) AS response -»
      «EXPAND Responses(spec, this) FOR response -»
    «ENDFOREACH -»
    «REM»Resolve OpenAPI specification specific error responses«ENDREM»
    «IF hasCustomResponse(spec) == true -»
        «EXPAND Responses(spec, this) FOREACH getCustomResponses(spec).sortBy(e|e.statusCodes) -» 
    «REM»Resolve global error responses«ENDREM»
    «ELSE -»
        «EXPAND Responses(spec, this) FOREACH getGlobalDefaultErrorResponses(spec.getModel()) -» 
    «ENDIF -»
«ENDDEFINE»

«DEFINE Responses(OpenAPI3Specification spec, RESTOperation operation) FOR OpenAPIResponse -»
	«IF this.isResponseApplicable(operation) -»
	«FOREACH this.statusCodes.sortBy(e|e) AS errorCode-»
        '«errorCode.getErrorCode()»':
          $ref: «this.getResponseType(spec)»
	«ENDFOREACH-»
    «IF this.unexpectedErrorResponse == true-»
        'default':
          $ref: «this.getResponseType(spec)»
	«ENDIF-»
	«ENDIF-»
«ENDDEFINE»




© 2015 - 2024 Weber Informatics LLC | Privacy Policy