Ejemplo n.º 1
0
        /// <summary>Gets the schema for the mapped type.</summary>
        /// <param name="schema">The schema.</param>
        /// <param name="context">The context.</param>
        public void GenerateSchema(JsonSchema schema, TypeMapperContext context)
        {
            if (!context.JsonSchemaResolver.HasSchema(MappedType, false))
            {
                context.JsonSchemaResolver.AddSchema(MappedType, false, _schemaFactory(context.JsonSchemaGenerator, context.JsonSchemaResolver));
            }

            schema.Reference = context.JsonSchemaResolver.GetSchema(MappedType, false);
        }
Ejemplo n.º 2
0
        /// <summary>Gets the schema for the mapped type.</summary>
        /// <param name="schema">The schema.</param>
        /// <param name="context">The context.</param>
#pragma warning disable 1998
        public async Task GenerateSchemaAsync(JsonSchema4 schema, TypeMapperContext context)
#pragma warning restore 1998
        {
            if (!context.JsonSchemaResolver.HasSchema(MappedType, false))
            {
                context.JsonSchemaResolver.AddSchema(MappedType, false, await _schemaFactory(context.JsonSchemaGenerator, context.JsonSchemaResolver));
            }

            schema.Reference = context.JsonSchemaResolver.GetSchema(MappedType, false);
        }
Ejemplo n.º 3
0
 /// <summary>Gets the schema for the mapped type.</summary>
 /// <param name="schema">The schema.</param>
 /// <param name="context">The context.</param>
 public async Task GenerateSchemaAsync(JsonSchema4 schema, TypeMapperContext context)
 {
     _transformer(schema);
 }
Ejemplo n.º 4
0
 /// <summary>Gets the schema for the mapped type.</summary>
 /// <param name="schema">The schema.</param>
 /// <param name="context">The context.</param>
 public void GenerateSchema(JsonSchema schema, TypeMapperContext context)
 {
     _transformer(schema);
 }
Ejemplo n.º 5
0
        /// <summary>Gets the schema for the mapped type.</summary>
        /// <param name="schema">The schema.</param>
        /// <param name="context">The context.</param>
#pragma warning disable 1998
        public async Task GenerateSchemaAsync(JsonSchema4 schema, TypeMapperContext context)
#pragma warning restore 1998
        {
            _transformer(schema);
        }