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

com.regnosys.rosetta.generator.jsonschema.JsonSchemaTranslator.xtend Maven / Gradle / Ivy

There is a newer version: 11.27.1
Show newest version
package com.regnosys.rosetta.generator.jsonschema

import com.regnosys.rosetta.generator.object.ExpandedType

class JsonSchemaTranslator {
				
	static def toJsonSchemaBasicType(String typename) {
		switch typename {
			case 'string',
			case 'time',
			case 'date',
			case 'dateTime',
			case 'zonedDateTime',
			case 'calculation':
				'string'
			case 'int':
				'integer'
			case 'number':
				'number'
			case 'boolean':
				'boolean'
		}
	}

	static def toJsonSchemaType(ExpandedType type) {
		val basicType = JsonSchemaTranslator.toJsonSchemaBasicType(type.name);
		if (basicType !== null)
			return basicType
		else
			return type.name.toFirstUpper
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy