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

com.reprezen.genflow.openapi3.doc.ResponseDoc.xtend Maven / Gradle / Ivy

package com.reprezen.genflow.openapi3.doc

import com.reprezen.kaizen.oasparser.model3.OpenApi3
import com.reprezen.kaizen.oasparser.model3.Response

class ResponseDoc {

	val OpenApi3 model = HelperHelper.model
	val String status
	extension DocHelper = HelperHelper.docHelper
	extension ResponseHelper = HelperHelper.responseHelper
	extension SchemaHelper = HelperHelper.schemaHelper
	extension HtmlHelper = HelperHelper.htmlHelper
	extension ExamplesHelper = HelperHelper.examplesHelper

	new(String status) {
		this.status = status
	}

	def getHtml() {
		'''«model.responses.get(status)?.responseHtml»'''
	}

	def getResponseHtml(Response response) {
		val mediaType = response.contentMediaTypes.values.head
		val schema = mediaType?.schema

		'''
			
			

«status»

Response «chevron» «schema?.schemaTitle» «response.description?.docHtml» «schema?.renderSchema» «response.getResponseHeaders» «mediaType?.examples.renderExamples»
''' } def private getResponseHeaders(Response response) { val html = response.getHeadersHtml if (html !== null) { '''

Headers

«html» ''' } } def chevron() { '' } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy