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

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

/*******************************************************************************
 * Copyright © 2013, 2016 Modelsolv, Inc.
 * All Rights Reserved.
 * 
 * NOTICE: All information contained herein is, and remains the property
 * of ModelSolv, Inc. See the file license.html in the root directory of
 * this project for further information.
 *******************************************************************************/
package com.reprezen.genflow.openapi3.doc

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

class PathDoc {
	val OpenApi3 model = HelperHelper.model
	val String pathName
	val Path path

	extension DocHelper = HelperHelper.docHelper
	extension TagHelper = HelperHelper.tagHelper
	extension HtmlHelper = HelperHelper.htmlHelper
	extension MiscHelper = HelperHelper.miscHelper
	extension OptionHelper = HelperHelper.optionHelper

	new(String pathName) {
		this.pathName = pathName
		this.path = model.paths.get(pathName)
	}

	new(String pathName, Path path) {
		this.pathName = pathName
		this.path = path
	}

	def getHtml() {
		'''
			
			

Path: «pathName» «IF preview»    «ENDIF»

«path.commonTags.map[it.modelTag?.description].filterNull.join("\n\n").docHtml» «FOR method : path.operations.keySet.sortByPosition(path.operations)» «new OpDoc(path.operations.get(method), model, path).getHtml(method)» «ENDFOR»
''' } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy