Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RefitStubs.g.cs is empty #715

Closed
wahmedswl opened this issue Jul 18, 2019 · 4 comments
Closed

[BUG] RefitStubs.g.cs is empty #715

wahmedswl opened this issue Jul 18, 2019 · 4 comments

Comments

@wahmedswl
Copy link

Describe the bug

RefitStubs.g.cs generated is empty, checked it in obj folder

// <auto-generated />
using System;
using System.Net.Http;
using System.Collections.Generic;

/* ******** Hey You! *********
 *
 * This is a generated file, and gets rewritten every time you build the
 * project. If you want to edit it, you need to edit the mustache template
 * in the Refit package */

#pragma warning disable
namespace TwilioApi.Model.RefitInternalGenerated
{
    [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
    [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate)]
    sealed class PreserveAttribute : Attribute
    {

        //
        // Fields
        //
        public bool AllMembers;

        public bool Conditional;
    }
}
#pragma warning restore

I have following interface defined with Refit

using Refit;
using SequelMed.Core;
using System.Collections.Generic;
using System.Threading.Tasks;
using Twilio.Rest.Studio.V1.Flow;

namespace TwilioApi.Model
{
    public interface IReminderClient
    {
        [Post("/" + Routes.PF_REMINDER + "/" + Routes.REMINDER_SEND)]
        Task<Envelope<ExecutionResource>> Send(ReminderRequest payload);

        [Post("/" + Routes.PF_REMINDER + "/" + Routes.REMINDER_RESPONSE)]
        Task<Envelope<string>> Response(ReminderRequest payload);

        [Post("/" + Routes.PF_REMINDER + "/" + Routes.REMINDER_PULL)]
        Task<Envelope<List<ReminderResponse>>> Pull(ReminderRequest payload);

        [Post("/" + Routes.PF_REMINDER + "/" + Routes.REMINDER_ACK)]
        Task<Envelope<string>> Acknowledge(ReminderRequest payload);
    }
}

Steps To Reproduce

Expected behavior

Screenshots

Environment

  • OS: Windows, .Net461
  • Version
  • Device:

Additional context

@wahmedswl wahmedswl added the bug label Jul 18, 2019
@clairernovotny
Copy link
Member

Have you tried it without the constants?

@wahmedswl
Copy link
Author

@onovotny thanks for your reply. Yes, it worked without Constants. So, is this the way to go and Constants won't work?

@clairernovotny
Copy link
Member

Correct, see the main issue here:
#602

Closing as dup of #602

@jamiehowarth0
Copy link
Member

I added comments on #263, basically constants aren't supported as default values in any optional params, up to and including C# 8, I don't see why we should support them in param values, as it'll involve Roslyn work which would require a refactor too substantial to warrant as a feature improvement.

@lock lock bot added the outdated label Oct 16, 2019
@lock lock bot locked and limited conversation to collaborators Oct 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants