Пример #1
0
        /// <summary>Generates the type.</summary>
        /// <param name="schema">The schema.</param>
        /// <param name="typeNameHint">The type name hint.</param>
        /// <returns>The code.</returns>
        protected override CodeArtifact GenerateType(JsonSchema4 schema, string typeNameHint)
        {
            var typeName = _resolver.GetOrGenerateTypeName(schema, typeNameHint);

            if (schema.IsEnumeration)
            {
                return(GenerateEnum(schema, typeName));
            }
            else
            {
                return(GenerateClass(schema, typeName));
            }
        }
Пример #2
0
        /// <summary>Generates the type.</summary>
        /// <param name="typeNameHint">The type name hint.</param>
        /// <returns>The code.</returns>
        public override TypeGeneratorResult GenerateType(string typeNameHint)
        {
            var typeName = _resolver.GetOrGenerateTypeName(_schema, typeNameHint);

            if (_schema.IsEnumeration)
            {
                return(GenerateEnum(typeName));
            }
            else
            {
                return(GenerateClass(typeName));
            }
        }