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

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

package com.reprezen.genflow.openapi3.doc

import com.reprezen.jsonoverlay.JsonOverlay
import com.reprezen.jsonoverlay.Overlay
import com.reprezen.kaizen.oasparser.model3.Schema

class KaiZenParserHelper {
	def  T asNullIfMissing(T el) {
		// FIXME nested elements are always initialized (non null), provide a better solution
		if ((el instanceof JsonOverlay) && !Overlay.of(el as JsonOverlay).isPresent) {
			return null
		}
		return el
	}

	def String getKaiZenSchemaName(Schema schema) {
		return Overlay.of(schema).pathInParent
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy