diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/.g.cs
new file mode 100644
index 000000000..a1559e5bf
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/.g.cs
@@ -0,0 +1,737 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.NoFilename
+{
+ /// Swagger Petstore - OpenAPI 3.0
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ISwaggerPetstore
+ {
+ /// Update an existing pet
+ /// Update an existing pet by Id
+ /// Update an existent pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ /// -
+ /// 405
+ /// Validation exception
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Put("/pet")]
+ Task UpdatePet([Body] Pet body);
+
+ /// Add a new pet to the store
+ /// Add a new pet to the store
+ /// Create a new pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/pet")]
+ Task AddPet([Body] Pet body);
+
+ /// Finds Pets by status
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid status value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByStatus")]
+ Task> FindPetsByStatus([Query] Status? status);
+
+ /// Finds Pets by tags
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid tag value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByTags")]
+ Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags);
+
+ /// Find pet by ID
+ /// Returns a single pet
+ /// ID of pet to return
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json")]
+ [Get("/pet/{petId}")]
+ Task GetPetById(long petId);
+
+ /// Updates a pet in the store with form data
+ /// ID of pet that needs to be updated
+ /// Name of pet that needs to be updated
+ /// Status of pet that needs to be updated
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Post("/pet/{petId}")]
+ Task UpdatePetWithForm(long petId, [Query] string name, [Query] string status);
+
+ /// Deletes a pet
+ /// api_key parameter
+ /// Pet id to delete
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid pet value
+ ///
+ ///
+ ///
+ [Delete("/pet/{petId}")]
+ Task DeletePet(long petId, [Header("api_key")] string api_key);
+
+ /// uploads an image
+ /// ID of pet to update
+ /// Additional Metadata
+ /// body parameter
+ ///
+ /// A representing the instance containing the result:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 200
+ /// successful operation
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task UploadFile(long petId, [Query] string additionalMetadata, StreamPart body);
+
+ /// Returns pet inventories by status
+ /// Returns a map of status codes to quantities
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json")]
+ [Get("/store/inventory")]
+ Task> GetInventory();
+
+ /// Place an order for a pet
+ /// Place a new order in the store
+ /// body parameter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/json")]
+ [Post("/store/order")]
+ Task PlaceOrder([Body] Order body);
+
+ /// Find purchase order by ID
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ /// ID of order that needs to be fetched
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/store/order/{orderId}")]
+ Task GetOrderById(long orderId);
+
+ /// Delete purchase order by ID
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Delete("/store/order/{orderId}")]
+ Task DeleteOrder(long orderId);
+
+ /// Create user
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json, application/xml", "Content-Type: application/json")]
+ [Post("/user")]
+ Task CreateUser([Body] User body);
+
+ /// Creates list of users with given input array
+ /// Creates list of users with given input array
+ /// body parameter
+ /// Successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task CreateUsersWithListInput([Body] IEnumerable body);
+
+ /// Logs user into the system
+ /// The user name for login
+ /// The password for login in clear text
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username/password supplied
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/login")]
+ Task LoginUser([Query] string username, [Query] string password);
+
+ /// Logs out current logged in user session
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Get("/user/logout")]
+ Task LogoutUser();
+
+ /// Get user by user name
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/{username}")]
+ Task GetUserByName(string username);
+
+ /// Update user
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Update an existent user in the store
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task UpdateUser(string username, [Body] User body);
+
+ /// Delete user
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Delete("/user/{username}")]
+ Task DeleteUser(string username);
+
+ }
+
+
+}
+
+//----------------------
+//
+// Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
+#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
+#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
+#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
+#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
+#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
+#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type"
+#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
+#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
+
+namespace Refitter.Tests.AdditionalFiles.NoFilename
+{
+ using System = global::System;
+
+
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Order
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("petId")]
+ public long PetId { get; set; }
+
+ [JsonPropertyName("quantity")]
+ public int Quantity { get; set; }
+
+ [JsonPropertyName("shipDate")]
+ public System.DateTimeOffset ShipDate { get; set; }
+
+ ///
+ /// Order Status
+ ///
+ [JsonPropertyName("status")]
+public OrderStatus Status { get; set; }
+
+ [JsonPropertyName("complete")]
+ public bool Complete { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Customer
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("address")]
+ public ICollection Address { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Address
+ {
+
+ [JsonPropertyName("street")]
+ public string Street { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("state")]
+ public string State { get; set; }
+
+ [JsonPropertyName("zip")]
+ public string Zip { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Category
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class User
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("password")]
+ public string Password { get; set; }
+
+ [JsonPropertyName("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// User Status
+ ///
+ [JsonPropertyName("userStatus")]
+ public int UserStatus { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Tag
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Pet
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
+ public string Name { get; set; }
+
+ [JsonPropertyName("category")]
+ public Category Category { get; set; }
+
+ [JsonPropertyName("photoUrls")]
+ [System.ComponentModel.DataAnnotations.Required]
+ public ICollection PhotoUrls { get; set; } = new System.Collections.ObjectModel.Collection();
+
+ [JsonPropertyName("tags")]
+ public ICollection Tags { get; set; }
+
+ ///
+ /// pet status in the store
+ ///
+ [JsonPropertyName("status")]
+public PetStatus Status { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class ApiResponse
+ {
+
+ [JsonPropertyName("code")]
+ public int Code { get; set; }
+
+ [JsonPropertyName("type")]
+ public string Type { get; set; }
+
+ [JsonPropertyName("message")]
+ public string Message { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum Status
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum OrderStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"placed")]
+ Placed = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"approved")]
+ Approved = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"delivered")]
+ Delivered = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum PetStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class FileParameter
+ {
+ public FileParameter(System.IO.Stream data)
+ : this (data, null, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName)
+ : this (data, fileName, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName, string contentType)
+ {
+ Data = data;
+ FileName = fileName;
+ ContentType = contentType;
+ }
+
+ public System.IO.Stream Data { get; private set; }
+
+ public string FileName { get; private set; }
+
+ public string ContentType { get; private set; }
+ }
+
+
+}
+
+#pragma warning restore 108
+#pragma warning restore 114
+#pragma warning restore 472
+#pragma warning restore 612
+#pragma warning restore 649
+#pragma warning restore 1573
+#pragma warning restore 1591
+#pragma warning restore 8073
+#pragma warning restore 3016
+#pragma warning restore 8600
+#pragma warning restore 8602
+#pragma warning restore 8603
+#pragma warning restore 8604
+#pragma warning restore 8625
+#pragma warning restore 8765
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/PropertyNamingPolicy.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/PropertyNamingPolicy.g.cs
new file mode 100644
index 000000000..759f9aa78
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/PropertyNamingPolicy.g.cs
@@ -0,0 +1,114 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.PropertyNamingPolicy
+{
+ /// Recursive Property Naming API
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IRecursivePropertyNamingApi
+ {
+ /// Success
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json")]
+ [Get("/nodes")]
+ Task GetNode();
+
+ }
+
+
+}
+
+//----------------------
+//
+// Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
+#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
+#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
+#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
+#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
+#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
+#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type"
+#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
+#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
+
+namespace Refitter.Tests.PropertyNamingPolicy
+{
+ using System = global::System;
+
+
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class RecursiveNode
+ {
+
+ [JsonPropertyName("node_id")]
+ public int node_id { get; set; }
+
+ [JsonPropertyName("class")]
+ public string @class { get; set; }
+
+ [JsonPropertyName("1st-node")]
+ public string _1st_node { get; set; }
+
+ [JsonPropertyName("child_count")]
+ public long child_count { get; set; }
+
+ [JsonPropertyName("next_node")]
+ public RecursiveNode next_node { get; set; }
+
+ [JsonPropertyName("children")]
+ public ICollection children { get; set; }
+
+ [JsonPropertyName("named_nodes")]
+ public IDictionary named_nodes { get; set; }
+
+ [JsonPropertyName("external_node")]
+ public RecursiveExternalNode external_node { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+
+}
+
+#pragma warning restore 108
+#pragma warning restore 114
+#pragma warning restore 472
+#pragma warning restore 612
+#pragma warning restore 649
+#pragma warning restore 1573
+#pragma warning restore 1591
+#pragma warning restore 8073
+#pragma warning restore 3016
+#pragma warning restore 8600
+#pragma warning restore 8602
+#pragma warning restore 8603
+#pragma warning restore 8604
+#pragma warning restore 8625
+#pragma warning restore 8765
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfaces.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfaces.g.cs
new file mode 100644
index 000000000..e3b630128
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfaces.g.cs
@@ -0,0 +1,691 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading;
+using System.Threading.Tasks;
+
+using Refitter.Tests.AdditionalFiles.SingeInterface;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.ByEndpoint
+{
+ /// Update an existing pet
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IUpdatePetEndpoint
+ {
+ /// Update an existing pet
+ /// Update an existing pet by Id
+ /// Update an existent pet in the store
+ /// The cancellation token to cancel the request.
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ /// -
+ /// 405
+ /// Validation exception
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Put("/pet")]
+ Task Execute([Body] Pet body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Add a new pet to the store
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IAddPetEndpoint
+ {
+ /// Add a new pet to the store
+ /// Add a new pet to the store
+ /// Create a new pet in the store
+ /// The cancellation token to cancel the request.
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Post("/pet")]
+ Task Execute([Body] Pet body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Finds Pets by status
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IFindPetsByStatusEndpoint
+ {
+ /// Finds Pets by status
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid status value
+ ///
+ ///
+ ///
+ [Get("/pet/findByStatus")]
+ Task> Execute([Query] Status? status, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Finds Pets by tags
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IFindPetsByTagsEndpoint
+ {
+ /// Finds Pets by tags
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid tag value
+ ///
+ ///
+ ///
+ [Get("/pet/findByTags")]
+ Task> Execute([Query(CollectionFormat.Multi)] IEnumerable tags, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Find pet by ID
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IGetPetByIdEndpoint
+ {
+ /// Find pet by ID
+ /// Returns a single pet
+ /// ID of pet to return
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ ///
+ ///
+ [Get("/pet/{petId}")]
+ Task Execute(long petId, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Updates a pet in the store with form data
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IUpdatePetWithFormEndpoint
+ {
+ /// Updates a pet in the store with form data
+ /// ID of pet that needs to be updated
+ /// Name of pet that needs to be updated
+ /// Status of pet that needs to be updated
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Post("/pet/{petId}")]
+ Task Execute(long petId, [Query] string name, [Query] string status, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Deletes a pet
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IDeletePetEndpoint
+ {
+ /// Deletes a pet
+ /// api_key parameter
+ /// Pet id to delete
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid pet value
+ ///
+ ///
+ ///
+ [Delete("/pet/{petId}")]
+ Task Execute(long petId, [Header("api_key")] string api_key, CancellationToken cancellationToken = default);
+
+ }
+
+ /// uploads an image
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IUploadFileEndpoint
+ {
+ /// uploads an image
+ /// ID of pet to update
+ /// Additional Metadata
+ /// body parameter
+ /// The cancellation token to cancel the request.
+ ///
+ /// A representing the instance containing the result:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 200
+ /// successful operation
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task Execute(long petId, [Query] string additionalMetadata, StreamPart body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Returns pet inventories by status
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IGetInventoryEndpoint
+ {
+ /// Returns pet inventories by status
+ /// Returns a map of status codes to quantities
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Get("/store/inventory")]
+ Task> Execute(CancellationToken cancellationToken = default);
+
+ }
+
+ /// Place an order for a pet
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IPlaceOrderEndpoint
+ {
+ /// Place an order for a pet
+ /// Place a new order in the store
+ /// body parameter
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Post("/store/order")]
+ Task Execute([Body] Order body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Find purchase order by ID
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IGetOrderByIdEndpoint
+ {
+ /// Find purchase order by ID
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ /// ID of order that needs to be fetched
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Get("/store/order/{orderId}")]
+ Task Execute(long orderId, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Delete purchase order by ID
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IDeleteOrderEndpoint
+ {
+ /// Delete purchase order by ID
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Delete("/store/order/{orderId}")]
+ Task Execute(long orderId, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Create user
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ICreateUserEndpoint
+ {
+ /// Create user
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Post("/user")]
+ Task Execute([Body] User body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Creates list of users with given input array
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ICreateUsersWithListInputEndpoint
+ {
+ /// Creates list of users with given input array
+ /// Creates list of users with given input array
+ /// body parameter
+ /// The cancellation token to cancel the request.
+ /// Successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task Execute([Body] IEnumerable body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Logs user into the system
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ILoginUserEndpoint
+ {
+ /// Logs user into the system
+ /// The user name for login
+ /// The password for login in clear text
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username/password supplied
+ ///
+ ///
+ ///
+ [Get("/user/login")]
+ Task Execute([Query] string username, [Query] string password, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Logs out current logged in user session
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ILogoutUserEndpoint
+ {
+ /// Logs out current logged in user session
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Get("/user/logout")]
+ Task Execute(CancellationToken cancellationToken = default);
+
+ }
+
+ /// Get user by user name
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IGetUserByNameEndpoint
+ {
+ /// Get user by user name
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// The cancellation token to cancel the request.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Get("/user/{username}")]
+ Task Execute(string username, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Update user
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IUpdateUserEndpoint
+ {
+ /// Update user
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Update an existent user in the store
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task Execute(string username, [Body] User body, CancellationToken cancellationToken = default);
+
+ }
+
+ /// Delete user
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IDeleteUserEndpoint
+ {
+ /// Delete user
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// The cancellation token to cancel the request.
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Delete("/user/{username}")]
+ Task Execute(string username, CancellationToken cancellationToken = default);
+
+ }
+
+}
+
+
+
+
+
+#nullable enable
+namespace Refitter.Tests.AdditionalFiles.ByEndpoint
+{
+ using System;
+ using Microsoft.Extensions.DependencyInjection;
+ using Refit;
+
+ ///
+ /// Extension methods for configuring Refit clients in the service collection.
+ ///
+ public static partial class IServiceCollectionExtensions
+ {
+ ///
+ /// Configures the Refit clients for dependency injection.
+ ///
+ /// The service collection to configure.
+ /// The base URL for the API clients.
+ /// Optional action to configure the HTTP client builder.
+ /// Optional Refit settings to customize serialization and other behaviors.
+ /// The configured service collection.
+ public static IServiceCollection ConfigureRefitClients(
+ this IServiceCollection services,
+ Uri baseUrl,
+ Action? builder = default,
+ RefitSettings? settings = default)
+ {
+ var clientBuilderIUpdatePetEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIUpdatePetEndpoint);
+
+ var clientBuilderIAddPetEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIAddPetEndpoint);
+
+ var clientBuilderIFindPetsByStatusEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIFindPetsByStatusEndpoint);
+
+ var clientBuilderIFindPetsByTagsEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIFindPetsByTagsEndpoint);
+
+ var clientBuilderIGetPetByIdEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIGetPetByIdEndpoint);
+
+ var clientBuilderIUpdatePetWithFormEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIUpdatePetWithFormEndpoint);
+
+ var clientBuilderIDeletePetEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIDeletePetEndpoint);
+
+ var clientBuilderIUploadFileEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIUploadFileEndpoint);
+
+ var clientBuilderIGetInventoryEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIGetInventoryEndpoint);
+
+ var clientBuilderIPlaceOrderEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIPlaceOrderEndpoint);
+
+ var clientBuilderIGetOrderByIdEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIGetOrderByIdEndpoint);
+
+ var clientBuilderIDeleteOrderEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIDeleteOrderEndpoint);
+
+ var clientBuilderICreateUserEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderICreateUserEndpoint);
+
+ var clientBuilderICreateUsersWithListInputEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderICreateUsersWithListInputEndpoint);
+
+ var clientBuilderILoginUserEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderILoginUserEndpoint);
+
+ var clientBuilderILogoutUserEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderILogoutUserEndpoint);
+
+ var clientBuilderIGetUserByNameEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIGetUserByNameEndpoint);
+
+ var clientBuilderIUpdateUserEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIUpdateUserEndpoint);
+
+ var clientBuilderIDeleteUserEndpoint = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = baseUrl)
+ .AddHttpMessageHandler()
+ .AddHttpMessageHandler();
+
+ builder?.Invoke(clientBuilderIDeleteUserEndpoint);
+
+ return services;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfacesByTag.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfacesByTag.g.cs
new file mode 100644
index 000000000..590f9a485
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreMultipleInterfacesByTag.g.cs
@@ -0,0 +1,388 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+using Refitter.Tests.AdditionalFiles.SingeInterface;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.ByTag
+{
+ /// Everything about your Pets
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IPetApi
+ {
+ /// Update an existing pet
+ /// Update an existing pet by Id
+ /// Update an existent pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ /// -
+ /// 405
+ /// Validation exception
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Put("/pet")]
+ Task UpdatePet([Body] Pet body);
+
+ /// Add a new pet to the store
+ /// Add a new pet to the store
+ /// Create a new pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Post("/pet")]
+ Task AddPet([Body] Pet body);
+
+ /// Finds Pets by status
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid status value
+ ///
+ ///
+ ///
+ [Get("/pet/findByStatus")]
+ Task> FindPetsByStatus([Query] Status? status);
+
+ /// Finds Pets by tags
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid tag value
+ ///
+ ///
+ ///
+ [Get("/pet/findByTags")]
+ Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags);
+
+ /// Find pet by ID
+ /// Returns a single pet
+ /// ID of pet to return
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ ///
+ ///
+ [Get("/pet/{petId}")]
+ Task GetPetById(long petId);
+
+ /// Updates a pet in the store with form data
+ /// ID of pet that needs to be updated
+ /// Name of pet that needs to be updated
+ /// Status of pet that needs to be updated
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Post("/pet/{petId}")]
+ Task UpdatePetWithForm(long petId, [Query] string name, [Query] string status);
+
+ /// Deletes a pet
+ /// api_key parameter
+ /// Pet id to delete
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid pet value
+ ///
+ ///
+ ///
+ [Delete("/pet/{petId}")]
+ Task DeletePet(long petId, [Header("api_key")] string api_key);
+
+ /// uploads an image
+ /// ID of pet to update
+ /// Additional Metadata
+ /// body parameter
+ ///
+ /// A representing the instance containing the result:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 200
+ /// successful operation
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task UploadFile(long petId, [Query] string additionalMetadata, StreamPart body);
+
+ }
+
+ /// Operations about user
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IStoreApi
+ {
+ /// Returns pet inventories by status
+ /// Returns a map of status codes to quantities
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Get("/store/inventory")]
+ Task> GetInventory();
+
+ /// Place an order for a pet
+ /// Place a new order in the store
+ /// body parameter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Content-Type: application/json")]
+ [Post("/store/order")]
+ Task PlaceOrder([Body] Order body);
+
+ /// Find purchase order by ID
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ /// ID of order that needs to be fetched
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Get("/store/order/{orderId}")]
+ Task GetOrderById(long orderId);
+
+ /// Delete purchase order by ID
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Delete("/store/order/{orderId}")]
+ Task DeleteOrder(long orderId);
+
+ }
+
+ /// Access to Petstore orders
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface IUserApi
+ {
+ /// Create user
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Post("/user")]
+ Task CreateUser([Body] User body);
+
+ /// Creates list of users with given input array
+ /// Creates list of users with given input array
+ /// body parameter
+ /// Successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task CreateUsersWithListInput([Body] IEnumerable body);
+
+ /// Logs user into the system
+ /// The user name for login
+ /// The password for login in clear text
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username/password supplied
+ ///
+ ///
+ ///
+ [Get("/user/login")]
+ Task LoginUser([Query] string username, [Query] string password);
+
+ /// Logs out current logged in user session
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Get("/user/logout")]
+ Task LogoutUser();
+
+ /// Get user by user name
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Get("/user/{username}")]
+ Task GetUserByName(string username);
+
+ /// Update user
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Update an existent user in the store
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task UpdateUser(string username, [Body] User body);
+
+ /// Delete user
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Delete("/user/{username}")]
+ Task DeleteUser(string username);
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreOptionalParameters.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreOptionalParameters.g.cs
new file mode 100644
index 000000000..3f50d209b
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreOptionalParameters.g.cs
@@ -0,0 +1,737 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.OptionalParameters
+{
+ /// Swagger Petstore - OpenAPI 3.0
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ISwaggerPetstoreWithOptionalParameters
+ {
+ /// Update an existing pet
+ /// Update an existing pet by Id
+ /// Update an existent pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ /// -
+ /// 405
+ /// Validation exception
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Put("/pet")]
+ Task UpdatePet([Body] Pet body);
+
+ /// Add a new pet to the store
+ /// Add a new pet to the store
+ /// Create a new pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/pet")]
+ Task AddPet([Body] Pet body);
+
+ /// Finds Pets by status
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid status value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByStatus")]
+ Task> FindPetsByStatus([Query] Status? status = default);
+
+ /// Finds Pets by tags
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid tag value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByTags")]
+ Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable? tags = default);
+
+ /// Find pet by ID
+ /// Returns a single pet
+ /// ID of pet to return
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json")]
+ [Get("/pet/{petId}")]
+ Task GetPetById(long petId);
+
+ /// Updates a pet in the store with form data
+ /// ID of pet that needs to be updated
+ /// Name of pet that needs to be updated
+ /// Status of pet that needs to be updated
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Post("/pet/{petId}")]
+ Task UpdatePetWithForm(long petId, [Query] string? name = default, [Query] string? status = default);
+
+ /// Deletes a pet
+ /// api_key parameter
+ /// Pet id to delete
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid pet value
+ ///
+ ///
+ ///
+ [Delete("/pet/{petId}")]
+ Task DeletePet(long petId, [Header("api_key")] string? api_key = default);
+
+ /// uploads an image
+ /// ID of pet to update
+ /// Additional Metadata
+ /// body parameter
+ ///
+ /// A representing the instance containing the result:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 200
+ /// successful operation
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task UploadFile(long petId, StreamPart body, [Query] string? additionalMetadata = default);
+
+ /// Returns pet inventories by status
+ /// Returns a map of status codes to quantities
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json")]
+ [Get("/store/inventory")]
+ Task> GetInventory();
+
+ /// Place an order for a pet
+ /// Place a new order in the store
+ /// body parameter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/json")]
+ [Post("/store/order")]
+ Task PlaceOrder([Body] Order? body = default);
+
+ /// Find purchase order by ID
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ /// ID of order that needs to be fetched
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/store/order/{orderId}")]
+ Task GetOrderById(long orderId);
+
+ /// Delete purchase order by ID
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Delete("/store/order/{orderId}")]
+ Task DeleteOrder(long orderId);
+
+ /// Create user
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json, application/xml", "Content-Type: application/json")]
+ [Post("/user")]
+ Task CreateUser([Body] User? body = default);
+
+ /// Creates list of users with given input array
+ /// Creates list of users with given input array
+ /// body parameter
+ /// Successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task CreateUsersWithListInput([Body] IEnumerable? body = default);
+
+ /// Logs user into the system
+ /// The user name for login
+ /// The password for login in clear text
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username/password supplied
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/login")]
+ Task LoginUser([Query] string? username = default, [Query] string? password = default);
+
+ /// Logs out current logged in user session
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Get("/user/logout")]
+ Task LogoutUser();
+
+ /// Get user by user name
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/{username}")]
+ Task GetUserByName(string username);
+
+ /// Update user
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Update an existent user in the store
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task UpdateUser(string username, [Body] User? body = default);
+
+ /// Delete user
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Delete("/user/{username}")]
+ Task DeleteUser(string username);
+
+ }
+
+
+}
+
+//----------------------
+//
+// Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
+#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
+#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
+#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
+#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
+#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
+#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type"
+#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
+#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
+
+namespace Refitter.Tests.AdditionalFiles.OptionalParameters
+{
+ using System = global::System;
+
+
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Order
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("petId")]
+ public long PetId { get; set; }
+
+ [JsonPropertyName("quantity")]
+ public int Quantity { get; set; }
+
+ [JsonPropertyName("shipDate")]
+ public System.DateTimeOffset ShipDate { get; set; }
+
+ ///
+ /// Order Status
+ ///
+ [JsonPropertyName("status")]
+public OrderStatus Status { get; set; }
+
+ [JsonPropertyName("complete")]
+ public bool Complete { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Customer
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("address")]
+ public ICollection Address { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Address
+ {
+
+ [JsonPropertyName("street")]
+ public string Street { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("state")]
+ public string State { get; set; }
+
+ [JsonPropertyName("zip")]
+ public string Zip { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Category
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class User
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("password")]
+ public string Password { get; set; }
+
+ [JsonPropertyName("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// User Status
+ ///
+ [JsonPropertyName("userStatus")]
+ public int UserStatus { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Tag
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Pet
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
+ public string Name { get; set; }
+
+ [JsonPropertyName("category")]
+ public Category Category { get; set; }
+
+ [JsonPropertyName("photoUrls")]
+ [System.ComponentModel.DataAnnotations.Required]
+ public ICollection PhotoUrls { get; set; } = new System.Collections.ObjectModel.Collection();
+
+ [JsonPropertyName("tags")]
+ public ICollection Tags { get; set; }
+
+ ///
+ /// pet status in the store
+ ///
+ [JsonPropertyName("status")]
+public PetStatus Status { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class ApiResponse
+ {
+
+ [JsonPropertyName("code")]
+ public int Code { get; set; }
+
+ [JsonPropertyName("type")]
+ public string Type { get; set; }
+
+ [JsonPropertyName("message")]
+ public string Message { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum Status
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum OrderStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"placed")]
+ Placed = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"approved")]
+ Approved = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"delivered")]
+ Delivered = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum PetStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class FileParameter
+ {
+ public FileParameter(System.IO.Stream data)
+ : this (data, null, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName)
+ : this (data, fileName, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName, string contentType)
+ {
+ Data = data;
+ FileName = fileName;
+ ContentType = contentType;
+ }
+
+ public System.IO.Stream Data { get; private set; }
+
+ public string FileName { get; private set; }
+
+ public string ContentType { get; private set; }
+ }
+
+
+}
+
+#pragma warning restore 108
+#pragma warning restore 114
+#pragma warning restore 472
+#pragma warning restore 612
+#pragma warning restore 649
+#pragma warning restore 1573
+#pragma warning restore 1591
+#pragma warning restore 8073
+#pragma warning restore 3016
+#pragma warning restore 8600
+#pragma warning restore 8602
+#pragma warning restore 8603
+#pragma warning restore 8604
+#pragma warning restore 8625
+#pragma warning restore 8765
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithHttpResilience.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithHttpResilience.g.cs
new file mode 100644
index 000000000..9251c354f
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithHttpResilience.g.cs
@@ -0,0 +1,786 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.SingeInterfaceWithHttpResilience
+{
+ /// Swagger Petstore - OpenAPI 3.0
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ISwaggerPetstoreInterfaceWithHttpResilience
+ {
+ /// Update an existing pet
+ /// Update an existing pet by Id
+ /// Update an existent pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ /// -
+ /// 405
+ /// Validation exception
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Put("/pet")]
+ Task UpdatePet([Body] Pet body);
+
+ /// Add a new pet to the store
+ /// Add a new pet to the store
+ /// Create a new pet in the store
+ /// Successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/pet")]
+ Task AddPet([Body] Pet body);
+
+ /// Finds Pets by status
+ /// Multiple status values can be provided with comma separated strings
+ /// Status values that need to be considered for filter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid status value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByStatus")]
+ Task> FindPetsByStatus([Query] Status? status);
+
+ /// Finds Pets by tags
+ /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
+ /// Tags to filter by
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid tag value
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByTags")]
+ Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags);
+
+ /// Find pet by ID
+ /// Returns a single pet
+ /// ID of pet to return
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Pet not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/xml, application/json")]
+ [Get("/pet/{petId}")]
+ Task GetPetById(long petId);
+
+ /// Updates a pet in the store with form data
+ /// ID of pet that needs to be updated
+ /// Name of pet that needs to be updated
+ /// Status of pet that needs to be updated
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Post("/pet/{petId}")]
+ Task UpdatePetWithForm(long petId, [Query] string name, [Query] string status);
+
+ /// Deletes a pet
+ /// api_key parameter
+ /// Pet id to delete
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid pet value
+ ///
+ ///
+ ///
+ [Delete("/pet/{petId}")]
+ Task DeletePet(long petId, [Header("api_key")] string api_key);
+
+ /// uploads an image
+ /// ID of pet to update
+ /// Additional Metadata
+ /// body parameter
+ ///
+ /// A representing the instance containing the result:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 200
+ /// successful operation
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task UploadFile(long petId, [Query] string additionalMetadata, StreamPart body);
+
+ /// Returns pet inventories by status
+ /// Returns a map of status codes to quantities
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json")]
+ [Get("/store/inventory")]
+ Task> GetInventory();
+
+ /// Place an order for a pet
+ /// Place a new order in the store
+ /// body parameter
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 405
+ /// Invalid input
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json", "Content-Type: application/json")]
+ [Post("/store/order")]
+ Task PlaceOrder([Body] Order body);
+
+ /// Find purchase order by ID
+ /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
+ /// ID of order that needs to be fetched
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/store/order/{orderId}")]
+ Task GetOrderById(long orderId);
+
+ /// Delete purchase order by ID
+ /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
+ /// ID of the order that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid ID supplied
+ ///
+ /// -
+ /// 404
+ /// Order not found
+ ///
+ ///
+ ///
+ [Delete("/store/order/{orderId}")]
+ Task DeleteOrder(long orderId);
+
+ /// Create user
+ /// This can only be done by the logged in user.
+ /// Created user object
+ /// successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/json, application/xml", "Content-Type: application/json")]
+ [Post("/user")]
+ Task CreateUser([Body] User body);
+
+ /// Creates list of users with given input array
+ /// Creates list of users with given input array
+ /// body parameter
+ /// Successful operation
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task CreateUsersWithListInput([Body] IEnumerable body);
+
+ /// Logs user into the system
+ /// The user name for login
+ /// The password for login in clear text
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username/password supplied
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/login")]
+ Task LoginUser([Query] string username, [Query] string password);
+
+ /// Logs out current logged in user session
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Get("/user/logout")]
+ Task LogoutUser();
+
+ /// Get user by user name
+ /// The name that needs to be fetched. Use user1 for testing.
+ /// successful operation
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Headers("Accept: application/json")]
+ [Get("/user/{username}")]
+ Task GetUserByName(string username);
+
+ /// Update user
+ /// This can only be done by the logged in user.
+ /// name that need to be deleted
+ /// Update an existent user in the store
+ /// A that completes when the request is finished.
+ /// Thrown when the request returns a non-success status code.
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task UpdateUser(string username, [Body] User body);
+
+ /// Delete user
+ /// This can only be done by the logged in user.
+ /// The name that needs to be deleted
+ /// A that completes when the request is finished.
+ ///
+ /// Thrown when the request returns a non-success status code:
+ ///
+ ///
+ /// Status
+ /// Description
+ ///
+ /// -
+ /// 400
+ /// Invalid username supplied
+ ///
+ /// -
+ /// 404
+ /// User not found
+ ///
+ ///
+ ///
+ [Delete("/user/{username}")]
+ Task DeleteUser(string username);
+
+ }
+
+
+}
+
+//----------------------
+//
+// Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
+#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
+#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
+#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
+#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
+#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
+#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type"
+#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
+#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
+
+namespace Refitter.Tests.AdditionalFiles.SingeInterfaceWithHttpResilience
+{
+ using System = global::System;
+
+
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Order
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("petId")]
+ public long PetId { get; set; }
+
+ [JsonPropertyName("quantity")]
+ public int Quantity { get; set; }
+
+ [JsonPropertyName("shipDate")]
+ public System.DateTimeOffset ShipDate { get; set; }
+
+ ///
+ /// Order Status
+ ///
+ [JsonPropertyName("status")]
+public OrderStatus Status { get; set; }
+
+ [JsonPropertyName("complete")]
+ public bool Complete { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Customer
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("address")]
+ public ICollection Address { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Address
+ {
+
+ [JsonPropertyName("street")]
+ public string Street { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("state")]
+ public string State { get; set; }
+
+ [JsonPropertyName("zip")]
+ public string Zip { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Category
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class User
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("password")]
+ public string Password { get; set; }
+
+ [JsonPropertyName("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// User Status
+ ///
+ [JsonPropertyName("userStatus")]
+ public int UserStatus { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Tag
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Pet
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
+ public string Name { get; set; }
+
+ [JsonPropertyName("category")]
+ public Category Category { get; set; }
+
+ [JsonPropertyName("photoUrls")]
+ [System.ComponentModel.DataAnnotations.Required]
+ public ICollection PhotoUrls { get; set; } = new System.Collections.ObjectModel.Collection();
+
+ [JsonPropertyName("tags")]
+ public ICollection Tags { get; set; }
+
+ ///
+ /// pet status in the store
+ ///
+ [JsonPropertyName("status")]
+public PetStatus Status { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class ApiResponse
+ {
+
+ [JsonPropertyName("code")]
+ public int Code { get; set; }
+
+ [JsonPropertyName("type")]
+ public string Type { get; set; }
+
+ [JsonPropertyName("message")]
+ public string Message { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum Status
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum OrderStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"placed")]
+ Placed = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"approved")]
+ Approved = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"delivered")]
+ Delivered = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum PetStatus
+ {
+
+ [System.Runtime.Serialization.EnumMember(Value = @"available")]
+ Available = 0,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"pending")]
+ Pending = 1,
+
+ [System.Runtime.Serialization.EnumMember(Value = @"sold")]
+ Sold = 2,
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class FileParameter
+ {
+ public FileParameter(System.IO.Stream data)
+ : this (data, null, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName)
+ : this (data, fileName, null)
+ {
+ }
+
+ public FileParameter(System.IO.Stream data, string fileName, string contentType)
+ {
+ Data = data;
+ FileName = fileName;
+ ContentType = contentType;
+ }
+
+ public System.IO.Stream Data { get; private set; }
+
+ public string FileName { get; private set; }
+
+ public string ContentType { get; private set; }
+ }
+
+
+}
+
+#pragma warning restore 108
+#pragma warning restore 114
+#pragma warning restore 472
+#pragma warning restore 612
+#pragma warning restore 649
+#pragma warning restore 1573
+#pragma warning restore 1591
+#pragma warning restore 8073
+#pragma warning restore 3016
+#pragma warning restore 8600
+#pragma warning restore 8602
+#pragma warning restore 8603
+#pragma warning restore 8604
+#pragma warning restore 8625
+#pragma warning restore 8765
+
+
+
+#nullable enable
+namespace Refitter.Tests.AdditionalFiles.SingeInterfaceWithHttpResilience
+{
+ using System;
+ using Microsoft.Extensions.DependencyInjection;
+ using Microsoft.Extensions.Http.Resilience;
+ using Refit;
+
+ ///
+ /// Extension methods for configuring Refit clients in the service collection.
+ ///
+ public static partial class IServiceCollectionExtensions
+ {
+ ///
+ /// Configures the Refit clients for dependency injection.
+ ///
+ /// The service collection to configure.
+/// Optional action to configure the HTTP client builder.
+ /// Optional Refit settings to customize serialization and other behaviors.
+ /// The configured service collection.
+ public static IServiceCollection ConfigureRefitClients(
+ this IServiceCollection services,
+ Action? builder = default,
+ RefitSettings? settings = default)
+ {
+ var clientBuilderISwaggerPetstoreInterfaceWithHttpResilience = services
+ .AddRefitClient(settings)
+ .ConfigureHttpClient(c => c.BaseAddress = new Uri("https://petstore3.swagger.io/api/v3"));
+
+ clientBuilderISwaggerPetstoreInterfaceWithHttpResilience
+ .AddStandardResilienceHandler(config =>
+ {
+ config.Retry = new HttpRetryStrategyOptions
+ {
+ UseJitter = true,
+ MaxRetryAttempts = 3,
+ Delay = TimeSpan.FromSeconds(0.5)
+ };
+ });
+
+ builder?.Invoke(clientBuilderISwaggerPetstoreInterfaceWithHttpResilience);
+
+ return services;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithPolly.g.cs b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithPolly.g.cs
new file mode 100644
index 000000000..f9a7113ca
--- /dev/null
+++ b/src/Refitter.SourceGenerator.Tests/AdditionalFiles/Generated/SwaggerPetstoreSingleInterfaceWithPolly.g.cs
@@ -0,0 +1,488 @@
+//
+// This code was generated by Refitter.
+//
+
+
+using Refit;
+using System.Collections.Generic;
+using System.Text.Json.Serialization;
+using System.Threading.Tasks;
+
+#nullable enable annotations
+
+namespace Refitter.Tests.AdditionalFiles.SingeInterface
+{
+ [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.0.0.0")]
+ public partial interface ISwaggerPetstoreInterface
+ {
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Put("/pet")]
+ Task UpdatePet([Body] Pet body);
+
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/pet")]
+ Task AddPet([Body] Pet body);
+
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByStatus")]
+ Task> FindPetsByStatus([Query] Status? status);
+
+ [Headers("Accept: application/json")]
+ [Get("/pet/findByTags")]
+ Task> FindPetsByTags([Query(CollectionFormat.Multi)] IEnumerable tags);
+
+ [Headers("Accept: application/xml, application/json")]
+ [Get("/pet/{petId}")]
+ Task GetPetById(long petId);
+
+ [Post("/pet/{petId}")]
+ Task UpdatePetWithForm(long petId, [Query] string name, [Query] string status);
+
+ [Delete("/pet/{petId}")]
+ Task DeletePet(long petId, [Header("api_key")] string api_key);
+
+ [Headers("Accept: application/json", "Content-Type: application/octet-stream")]
+ [Post("/pet/{petId}/uploadImage")]
+ Task UploadFile(long petId, [Query] string additionalMetadata, StreamPart body);
+
+ [Headers("Accept: application/json")]
+ [Get("/store/inventory")]
+ Task> GetInventory();
+
+ [Headers("Accept: application/json", "Content-Type: application/json")]
+ [Post("/store/order")]
+ Task PlaceOrder([Body] Order body);
+
+ [Headers("Accept: application/json")]
+ [Get("/store/order/{orderId}")]
+ Task GetOrderById(long orderId);
+
+ [Delete("/store/order/{orderId}")]
+ Task DeleteOrder(long orderId);
+
+ [Headers("Accept: application/json, application/xml", "Content-Type: application/json")]
+ [Post("/user")]
+ Task CreateUser([Body] User body);
+
+ [Headers("Accept: application/xml, application/json", "Content-Type: application/json")]
+ [Post("/user/createWithList")]
+ Task CreateUsersWithListInput([Body] IEnumerable body);
+
+ [Headers("Accept: application/json")]
+ [Get("/user/login")]
+ Task LoginUser([Query] string username, [Query] string password);
+
+ [Get("/user/logout")]
+ Task LogoutUser();
+
+ [Headers("Accept: application/json")]
+ [Get("/user/{username}")]
+ Task GetUserByName(string username);
+
+ [Headers("Content-Type: application/json")]
+ [Put("/user/{username}")]
+ Task UpdateUser(string username, [Body] User body);
+
+ [Delete("/user/{username}")]
+ Task DeleteUser(string username);
+
+ }
+
+
+}
+
+//----------------------
+//
+// Generated using the NSwag toolchain v14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
+#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
+#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
+#pragma warning disable 612 // Disable "CS0612 '...' is obsolete"
+#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null"
+#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
+#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
+#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
+#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
+#pragma warning disable 8600 // Disable "CS8600 Converting null literal or possible null value to non-nullable type"
+#pragma warning disable 8602 // Disable "CS8602 Dereference of a possibly null reference"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type"
+#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)."
+
+namespace Refitter.Tests.AdditionalFiles.SingeInterface
+{
+ using System = global::System;
+
+
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Order
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("petId")]
+ public long PetId { get; set; }
+
+ [JsonPropertyName("quantity")]
+ public int Quantity { get; set; }
+
+ [JsonPropertyName("shipDate")]
+ public System.DateTimeOffset ShipDate { get; set; }
+
+ ///
+ /// Order Status
+ ///
+ [JsonPropertyName("status")]
+public OrderStatus Status { get; set; }
+
+ [JsonPropertyName("complete")]
+ public bool Complete { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Customer
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("address")]
+ public ICollection Address { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Address
+ {
+
+ [JsonPropertyName("street")]
+ public string Street { get; set; }
+
+ [JsonPropertyName("city")]
+ public string City { get; set; }
+
+ [JsonPropertyName("state")]
+ public string State { get; set; }
+
+ [JsonPropertyName("zip")]
+ public string Zip { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class Category
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("name")]
+ public string Name { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary AdditionalProperties
+ {
+ get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); }
+ set { _additionalProperties = value; }
+ }
+
+ }
+
+ [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.7.1.0 (NJsonSchema v11.6.1.0 (Newtonsoft.Json v13.0.0.0))")]
+ public partial class User
+ {
+
+ [JsonPropertyName("id")]
+ public long Id { get; set; }
+
+ [JsonPropertyName("username")]
+ public string Username { get; set; }
+
+ [JsonPropertyName("firstName")]
+ public string FirstName { get; set; }
+
+ [JsonPropertyName("lastName")]
+ public string LastName { get; set; }
+
+ [JsonPropertyName("email")]
+ public string Email { get; set; }
+
+ [JsonPropertyName("password")]
+ public string Password { get; set; }
+
+ [JsonPropertyName("phone")]
+ public string Phone { get; set; }
+
+ ///
+ /// User Status
+ ///
+ [JsonPropertyName("userStatus")]
+ public int UserStatus { get; set; }
+
+ private IDictionary _additionalProperties;
+
+ [JsonExtensionData]
+ public IDictionary