Nswag: OpenAPI3: Schema title property ignored when defined inline for RequestBody and Responses

Created on 28 Mar 2019  路  14Comments  路  Source: RicoSuter/NSwag

Disclaimer: There may be no intent to support this, I may be misunderstanding the OpenAPI3 Documentation, or there may be a setting for NSwagStudio that I have not found

Issue: I am receiving anonymous types/classes when I generate a C# Client in NSwagStudio

I have copied in the full YAML Specification (I tried initially with JSON, YAML might be easier to read for example purposes) and the C# file that NSwagStudio generated. The file generates and runs fine but is unsustainable for our project in the long term due to changes being made to the API.

Expected Result

When providing a title for a schema inline, the corresponding class that is created will be named accordingly

Actual Result

When a title is provided, the class based on the related schema is simply named either 'Anonymous', 'Response', or 'Body' with a number that increments appended to it (Anonymous2, etc.)

Related, but possible a Separate Issue

The method name says "WantAsync" instead of saying "ThisIsTheWholeNameIWantAsync", so I guess underscores are treated similarly to '/' and should either be removed from the names we use or something


Example Reference

In the example code I have pasted below, I would expect the class named 'Anonymous' to be named 'MyDesiredRequestTypeName' and 'Anonymous2' to be named 'MyDesiredResponseTypeName'


WORKAROUND

Manually move every schema from our pre-generated json to the components section and add a $ref to the schema instead of defining it inline.

Notes

I am investigating a change to how our JSON is generated but I believe that this is technically a bug or missing feature since the C# Client generation built in to 'editor.swagger.io' does "properly" name the classes (but I have run into other issues with the C# client they generate and have had success with NSwag so far)

openapi: 3.0.1
info:
  title: Hello
  description: This is the description
  version: 1.0.0
servers:
- url: ///This/URL
paths:
  /First/Second/This_Is_The_Whole_Name_I_Want:
    post:
      summary: This properly appears in the summary tags
      requestBody:
        content:
          application/json:
            schema:
              title: MyDesiredRequestTypeName
              type: object
              properties:
                CUSTOM_OBJECT_ARRAY:
                  type: array
                  items:
                    type: object
                    properties:
                      NumberOne:
                        type: string
                      NumberTwo:
                        type: string
        required: true
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                title: MyDesiredResponseTypeName
                type: object
                properties:
                  OBJECT_ARRAY:
                    type: array
                    items:
                      type: object
                      properties:
                        NumberOne:
                          type: string
                        NumberTwo:
                          type: string
                        NumberThree:
                          type: string
                        NumberFour:
                          type: string
                        NumberFive:
                          type: string
                        NumberSix:
                          type: string
                        NumberSeven:
                          type: string
                        NumberEight:
                          type: string
        500:
          description: error
          content: {}
components: {}
//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

namespace MyNamespace
{
    #pragma warning disable

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class IClient 
    {
        private string _baseUrl = "";
        private System.Net.Http.HttpClient _httpClient;
        private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;

        public IClient(string baseUrl, System.Net.Http.HttpClient httpClient)
        {
            BaseUrl = baseUrl; 
            _httpClient = httpClient; 
            _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(() => 
            {
                var settings = new Newtonsoft.Json.JsonSerializerSettings();
                UpdateJsonSerializerSettings(settings);
                return settings;
            });
        }

        public string BaseUrl 
        {
            get { return _baseUrl; }
            set { _baseUrl = value; }
        }

        protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }

        partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
        partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public System.Threading.Tasks.Task<Response> WantAsync(Body body)
        {
            return WantAsync(body, System.Threading.CancellationToken.None);
        }

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async System.Threading.Tasks.Task<Response> WantAsync(Body body, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/First/Second/This_Is_The_Whole_Name_I_Want");

            var client_ = _httpClient;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            var result_ = default(Response); 
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<Response>(responseData_, _settings.Value);
                                return result_; 
                            } 
                            catch (System.Exception exception_) 
                            {
                                throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
                            }
                        }
                        else
                        if (status_ == "500") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("error", (int)response_.StatusCode, responseData_, headers_, null);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return default(Response);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
            }
        }

        private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (value is System.Enum)
            {
                string name = System.Enum.GetName(value.GetType(), value);
                if (name != null)
                {
                    var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
                    if (field != null)
                    {
                        var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) 
                            as System.Runtime.Serialization.EnumMemberAttribute;
                        if (attribute != null)
                        {
                            return attribute.Value;
                        }
                    }
                }
            }
            else if (value is bool) {
                return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
            }
            else if (value is byte[])
            {
                return System.Convert.ToBase64String((byte[]) value);
            }
            else if (value != null && value.GetType().IsArray)
            {
                var array = System.Linq.Enumerable.OfType<object>((System.Array) value);
                return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
            }

            return System.Convert.ToString(value, cultureInfo);
        }
    }



    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Body 
    {
        [Newtonsoft.Json.JsonProperty("CUSTOM_OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<Anonymous> CUSTOM_OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Body FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Body>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Response 
    {
        [Newtonsoft.Json.JsonProperty("OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<Anonymous2> OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Response FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Response>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Anonymous 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Anonymous FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Anonymous>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Anonymous2 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberThree", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberThree { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFour", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFour { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFive", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFive { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSix", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSix { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSeven", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSeven { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberEight", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberEight { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Anonymous2 FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Anonymous2>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException : System.Exception
    {
        public int StatusCode { get; private set; }

        public string Response { get; private set; }

        public System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) 
            : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException)
        {
            StatusCode = statusCode;
            Response = response; 
            Headers = headers;
        }

        public override string ToString()
        {
            return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException<TResult> : SwaggerException
    {
        public TResult Result { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) 
            : base(message, statusCode, response, headers, innerException)
        {
            Result = result;
        }
    }

    #pragma warning restore
}

Editor.Swagger.IO C# Client - Single class example

personal opinion, they shouldn't append the whole path to the front of CustomObjectArray but I guess that doesn't hurt

using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;

namespace IO.Swagger.Model {

  /// <summary>
  /// 
  /// </summary>
  [DataContract]
  public class MyDesiredRequestTypeName {
    /// <summary>
    /// Gets or Sets CUSTOM_OBJECT_ARRAY
    /// </summary>
    [DataMember(Name="CUSTOM_OBJECT_ARRAY", EmitDefaultValue=false)]
    [JsonProperty(PropertyName = "CUSTOM_OBJECT_ARRAY")]
    public List<FirstSecondThisIsTheWholeNameIWantCUSTOMOBJECTARRAY> CUSTOM_OBJECT_ARRAY { get; set; }


    /// <summary>
    /// Get the string presentation of the object
    /// </summary>
    /// <returns>String presentation of the object</returns>
    public override string ToString()  {
      var sb = new StringBuilder();
      sb.Append("class MyDesiredRequestTypeName {\n");
      sb.Append("  CUSTOM_OBJECT_ARRAY: ").Append(CUSTOM_OBJECT_ARRAY).Append("\n");
      sb.Append("}\n");
      return sb.ToString();
    }

    /// <summary>
    /// Get the JSON string presentation of the object
    /// </summary>
    /// <returns>JSON string presentation of the object</returns>
    public string ToJson() {
      return JsonConvert.SerializeObject(this, Formatting.Indented);
    }

}
}

All 14 comments

The two schemas with title are generated as "Body" and "Request" (not using title ATM) and the anonymous classes are the inner schemas which do not have a title - adding support for "title" would not change the anonymous classes but only "Body" and "Request".

I will add a new setting UseTitleAsTypeName (default: false) so that the title is used if it is defined...

The recommended way to is to use $ref into components/definitions...

The method name is determined in the operation name generator, the default is MultipleClientsFromOperationIdOperationNameGenerator but you don't have operation ids in the form clientName_operationName:
https://github.com/RicoSuter/NSwag/tree/master/src/NSwag.CodeGeneration/OperationNameGenerators

First off, thanks for the super fast response time, you guys are really on top of this project!

Thanks for linking the OperationID Name Generation, that was a pretty big miss on my part.

As for the generically named classes: in the longer term I am pushing for Components and $REF to replace the current completely-inline situation, but I do think it is reasonable to define single-use components inline, which I think benefits from the 'UseTitleAsTypeName' you proposed.

~As you pointed out, though, that probably doesn't cover the Anonymous classes themselves, just the Body and Request classes. If you have any ideas for that I would definitely be interested in hearing them. Until we are able to completely move to components + $ref, they are dealing with referencing it like 'Anonymous7' where the number could change day to day as the source is under active development.~

^ That was simply solved by adding a title in the appropriate place

image

Thanks again for the help!

Yes, but this title is not considered as type name yet, right?

The highlighted title Test452345rf properly replaced the Anonymous type I was seeing.

The generically named Response and Body classes remained unchanged

I'd rather show too much than not enough, so here is the updated YAML and the corresponding output from NSwagStudio

openapi: 3.0.1
info:
  title: Hello
  description: This is the description
  version: 1.0.0
servers:
- url: ///This/URL
paths:
  /First/Second/This_Is_The_Whole_Name_I_Want:
    post:
      summary: This properly appears in the summary tags
      requestBody:
        content:
          application/json:
            schema:
              title: MyDesiredRequestTypeName
              type: object
              properties:
                CUSTOM_OBJECT_ARRAY:
                  type: array
                  items:
                    type: object
                    title: ReplaceAnon1
                    properties:
                      NumberOne:
                        type: string
                      NumberTwo:
                        type: string
        required: true
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                title: MyDesiredResponseTypeName
                type: object
                properties:
                  OBJECT_ARRAY:
                    type: array
                    items:
                      type: object
                      title: ReplaceAnon2
                      properties:
                        NumberOne:
                          type: string
                        NumberTwo:
                          type: string
                        NumberThree:
                          type: string
                        NumberFour:
                          type: string
                        NumberFive:
                          type: string
                        NumberSix:
                          type: string
                        NumberSeven:
                          type: string
                        NumberEight:
                          type: string
        500:
          description: error
          content: {}
components: {}
//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

namespace MyNamespace
{
    #pragma warning disable

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class Client 
    {
        private string _baseUrl = "";
        private System.Net.Http.HttpClient _httpClient;
        private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;

        public Client(string baseUrl, System.Net.Http.HttpClient httpClient)
        {
            BaseUrl = baseUrl; 
            _httpClient = httpClient; 
            _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(() => 
            {
                var settings = new Newtonsoft.Json.JsonSerializerSettings();
                UpdateJsonSerializerSettings(settings);
                return settings;
            });
        }

        public string BaseUrl 
        {
            get { return _baseUrl; }
            set { _baseUrl = value; }
        }

        protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }

        partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
        partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public System.Threading.Tasks.Task<Response> FirstSecondThisIsTheWholeNameIWantAsync(Body body)
        {
            return FirstSecondThisIsTheWholeNameIWantAsync(body, System.Threading.CancellationToken.None);
        }

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async System.Threading.Tasks.Task<Response> FirstSecondThisIsTheWholeNameIWantAsync(Body body, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/First/Second/This_Is_The_Whole_Name_I_Want");

            var client_ = _httpClient;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            var result_ = default(Response); 
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<Response>(responseData_, _settings.Value);
                                return result_; 
                            } 
                            catch (System.Exception exception_) 
                            {
                                throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
                            }
                        }
                        else
                        if (status_ == "500") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("error", (int)response_.StatusCode, responseData_, headers_, null);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return default(Response);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
            }
        }

        private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (value is System.Enum)
            {
                string name = System.Enum.GetName(value.GetType(), value);
                if (name != null)
                {
                    var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
                    if (field != null)
                    {
                        var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) 
                            as System.Runtime.Serialization.EnumMemberAttribute;
                        if (attribute != null)
                        {
                            return attribute.Value;
                        }
                    }
                }
            }
            else if (value is bool) {
                return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
            }
            else if (value is byte[])
            {
                return System.Convert.ToBase64String((byte[]) value);
            }
            else if (value != null && value.GetType().IsArray)
            {
                var array = System.Linq.Enumerable.OfType<object>((System.Array) value);
                return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
            }

            return System.Convert.ToString(value, cultureInfo);
        }
    }



    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Body 
    {
        [Newtonsoft.Json.JsonProperty("CUSTOM_OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<ReplaceAnon1> CUSTOM_OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Body FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Body>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class Response 
    {
        [Newtonsoft.Json.JsonProperty("OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<ReplaceAnon2> OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static Response FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<Response>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class ReplaceAnon1 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static ReplaceAnon1 FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReplaceAnon1>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class ReplaceAnon2 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberThree", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberThree { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFour", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFour { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFive", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFive { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSix", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSix { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSeven", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSeven { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberEight", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberEight { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static ReplaceAnon2 FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReplaceAnon2>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException : System.Exception
    {
        public int StatusCode { get; private set; }

        public string Response { get; private set; }

        public System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) 
            : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException)
        {
            StatusCode = statusCode;
            Response = response; 
            Headers = headers;
        }

        public override string ToString()
        {
            return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException<TResult> : SwaggerException
    {
        public TResult Result { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) 
            : base(message, statusCode, response, headers, innerException)
        {
            Result = result;
        }
    }

    #pragma warning restore
}

Ok, adding/enabling this feature by default is a breaking change...

For me, title is semantically the wrong property to be used as class name - for me a title is a UI title, e.g. "array item" (and not "ArrayItem") and I'd call the human readable type name "name". JSON Schema is does not exactly specify the purpose of title, but according to this sample it's more a title and not a type name:
https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.5

Here is the spec for title:
https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-6.1

Maybe it would make sense to remove the "Request" / "Body" default names and only use them as fallback if no title is defined (in the case of a respones or parameter object). Will check that... this is to avoid this new setting :-)

Using name instead of title does sound a bit better, especially if I'm trying to _name_ a type. But I'm not sure where name fits in to Open API 3 (currently going through the basic structure documentation of OpenAPI3 here and the supported Data Model Keywords here).

And to support the fact that using title this way is probably incorrect, if I update my YAML to use spaces like Replace Anon 2 instead of ReplaceAnon2 (neither of which throw errors in the editor) it reverts back to being Anonymous

No, I was just thinking out loud, open api 3 does not support that and I don't want to just introduce new custom properties which only NSwag understands... (we had this as x-name and switched to $ref based names). The recommended way is to always use $refs so that names are correct...

And to support the fact that using title this way is probably incorrect, if I update my YAML to use spaces like Replace Anon 2 instead of ReplaceAnon2 (neither of which throw errors in the editor) it reverts back to being Anonymous

Yes there is a check somewhere that checks whether the title is probably a type name...

Just checking whether we can change some defaults to fix your scenario...

I mentioned it in my original post, but using editor.swagger.io circumvents this by just stitching the path and key together. Meaning that the type of my OBJECT_ARRAY becomes FirstSecondThisIsTheWholeNameIWantOBJECTARRAY if you don't provide it a title (ReplaceAnon2 in my example)

I'm not sure that I love that, but it might be a better default than just Response.

TBH, I don't want to invest too much time into these fallbacks as either it breaks existing users (even if the code is ugly) and most users use NSwag to generate the spec and then all names are correctly named with $refs...

Still checking for a solution - had some compile problems :-)

TL;DR so far

Anonymous is (currently) easily fixed by a properly placed title property when written in-line with no "bad" characters like spaces OR by using components and $ref.

Response and Body are similarly fixed by using components and $ref.

title should probably only ever be used as a Descriptive Title, not as something meant to be a Type name.

defaults might be changeable but we don't want to break existing user's stuff

Reference in DefaultTypeNameGenerator (NJS):

image

The PR: https://github.com/RicoSuter/NSwag/pull/2059
will give you this output:

//----------------------
// <auto-generated>
//     Generated using the NSwag toolchain v12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

namespace MyNamespace
{
    #pragma warning disable

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class IClient 
    {
        private string _baseUrl = "";
        private System.Net.Http.HttpClient _httpClient;
        private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;

        public IClient(string baseUrl, System.Net.Http.HttpClient httpClient)
        {
            BaseUrl = baseUrl; 
            _httpClient = httpClient; 
            _settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(() => 
            {
                var settings = new Newtonsoft.Json.JsonSerializerSettings();
                UpdateJsonSerializerSettings(settings);
                return settings;
            });
        }

        public string BaseUrl 
        {
            get { return _baseUrl; }
            set { _baseUrl = value; }
        }

        protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }

        partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
        partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
        partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        public System.Threading.Tasks.Task<MyDesiredResponseTypeName> WantAsync(MyDesiredRequestTypeName body)
        {
            return WantAsync(body, System.Threading.CancellationToken.None);
        }

        /// <summary>This properly appears in the summary tags</summary>
        /// <returns>successful operation</returns>
        /// <exception cref="SwaggerException">A server side error occurred.</exception>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        public async System.Threading.Tasks.Task<MyDesiredResponseTypeName> WantAsync(MyDesiredRequestTypeName body, System.Threading.CancellationToken cancellationToken)
        {
            var urlBuilder_ = new System.Text.StringBuilder();
            urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/First/Second/This_Is_The_Whole_Name_I_Want");

            var client_ = _httpClient;
            try
            {
                using (var request_ = new System.Net.Http.HttpRequestMessage())
                {
                    var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value));
                    content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
                    request_.Content = content_;
                    request_.Method = new System.Net.Http.HttpMethod("POST");
                    request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

                    PrepareRequest(client_, request_, urlBuilder_);
                    var url_ = urlBuilder_.ToString();
                    request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
                    PrepareRequest(client_, request_, url_);

                    var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
                    try
                    {
                        var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
                        if (response_.Content != null && response_.Content.Headers != null)
                        {
                            foreach (var item_ in response_.Content.Headers)
                                headers_[item_.Key] = item_.Value;
                        }

                        ProcessResponse(client_, response_);

                        var status_ = ((int)response_.StatusCode).ToString();
                        if (status_ == "200") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            var result_ = default(MyDesiredResponseTypeName); 
                            try
                            {
                                result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<MyDesiredResponseTypeName>(responseData_, _settings.Value);
                                return result_; 
                            } 
                            catch (System.Exception exception_) 
                            {
                                throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
                            }
                        }
                        else
                        if (status_ == "500") 
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("error", (int)response_.StatusCode, responseData_, headers_, null);
                        }
                        else
                        if (status_ != "200" && status_ != "204")
                        {
                            var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); 
                            throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
                        }

                        return default(MyDesiredResponseTypeName);
                    }
                    finally
                    {
                        if (response_ != null)
                            response_.Dispose();
                    }
                }
            }
            finally
            {
            }
        }

        private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
        {
            if (value is System.Enum)
            {
                string name = System.Enum.GetName(value.GetType(), value);
                if (name != null)
                {
                    var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
                    if (field != null)
                    {
                        var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) 
                            as System.Runtime.Serialization.EnumMemberAttribute;
                        if (attribute != null)
                        {
                            return attribute.Value;
                        }
                    }
                }
            }
            else if (value is bool) {
                return System.Convert.ToString(value, cultureInfo).ToLowerInvariant();
            }
            else if (value is byte[])
            {
                return System.Convert.ToBase64String((byte[]) value);
            }
            else if (value != null && value.GetType().IsArray)
            {
                var array = System.Linq.Enumerable.OfType<object>((System.Array) value);
                return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
            }

            return System.Convert.ToString(value, cultureInfo);
        }
    }



    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class MyDesiredRequestTypeName 
    {
        [Newtonsoft.Json.JsonProperty("CUSTOM_OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<ReplaceAnon1> CUSTOM_OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static MyDesiredRequestTypeName FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<MyDesiredRequestTypeName>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class MyDesiredResponseTypeName 
    {
        [Newtonsoft.Json.JsonProperty("OBJECT_ARRAY", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public System.Collections.Generic.ICollection<ReplaceAnon2> OBJECT_ARRAY { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static MyDesiredResponseTypeName FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<MyDesiredResponseTypeName>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class ReplaceAnon1 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static ReplaceAnon1 FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReplaceAnon1>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.13.27.0 (Newtonsoft.Json v11.0.0.0)")]
    public partial class ReplaceAnon2 
    {
        [Newtonsoft.Json.JsonProperty("NumberOne", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberOne { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberTwo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberTwo { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberThree", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberThree { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFour", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFour { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberFive", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberFive { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSix", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSix { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberSeven", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberSeven { get; set; }

        [Newtonsoft.Json.JsonProperty("NumberEight", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
        public string NumberEight { get; set; }

        public string ToJson() 
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }

        public static ReplaceAnon2 FromJson(string data)
        {
            return Newtonsoft.Json.JsonConvert.DeserializeObject<ReplaceAnon2>(data);
        }

    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException : System.Exception
    {
        public int StatusCode { get; private set; }

        public string Response { get; private set; }

        public System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException) 
            : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException)
        {
            StatusCode = statusCode;
            Response = response; 
            Headers = headers;
        }

        public override string ToString()
        {
            return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.18.0 (NJsonSchema v9.13.27.0 (Newtonsoft.Json v11.0.0.0))")]
    public partial class SwaggerException<TResult> : SwaggerException
    {
        public TResult Result { get; private set; }

        public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException) 
            : base(message, statusCode, response, headers, innerException)
        {
            Result = result;
        }
    }

    #pragma warning restore
}
Was this page helpful?
0 / 5 - 0 ratings