All format types are disabled for Operation

Hello again,

I have a Operation which has Service Model like;


I have over 20 operation with different ResponseTypes but only this one shows all formats are disabled.

I know, I am doing something wrong but, what ?

Do you have any attributes on the Service class?

I can’t see anything wrong with that definition, are you using the [Restrict], [RequiredRole] attributes anywhere?

No as you can see there are 3 operations in service, but this one only with that situation.

I changed response type, request class name (if it is reserved word) but with no lock…

Can you try using Upper case GET for the HTTP Verb, or even better use the strong-typed constant:

[Route("/code/objectid", HttpMethods.Get)]

Also in future rather than screenshots can you paste the code as text so it’s easy to copy. To mark it as csharp you can just wrap it between the following markup:

```csharp
//add C# code
```

But that should work as well, I’ve tried to create a repro with your example in this commit, but the metadata page is still showing correctly.

Do you have the license key properly registered with your project so you’re not running into any free-quota limitations, i.e. if you comment out your other 2 services does it change how this works?

You can get some info on the metadata service from /types/metadata.json which may shed some light on the issue, Otherwise I can’t think of anything and would need to a small, stand-alone reproducible example (e.g on a GitHub repo) to investigate further.

I found the problem, it is with the request class name.
If the name has a capital i, it is the problem. Is this a bug? or is it related to with my environment? I have no idea.

I have license key registered and no problem with that.

Not:Sorry for the capturing codes, I am newbie here :smile:

Here is metadata.json

"Request":{"Name":"ObjectId","Namespace":"EsneqSS.ServiceModel","Implements":[],"ReturnVoidMarker":false,"ReturnMarkerTypeName":{"Name":"ObjectDesignResponse","Namespace":"EsneqSS.ServiceModel"},"Routes":[{"Path":"/code/object","Verbs":"GET","Notes":"","Summary":"Objenin adından objeyi döner"}],"Properties":[{"Name":"objectName","Type":"String","TypeNamespace":"System"}]}

Note: I changed response type here but it does not change the situation.

Which capital I the I in ObjectId? The name shouldn’t have any impact, but maybe ending with Id might - we look at it in inferring property references in OrmLite but this shouldn’t affect Request DTO’s, but not sure as I can’t repro the issue. Do you have any Auto Route Naming Strategies or some other non-standard configuration that may be affecting this?

Can you try renaming it to ObjectIds or ObjectId2 to see if it has any impact.

Yes I in the ObjectId.
I even tried the “ObjectIds”,“ObjectId2”,“ObjectI” and “ALI” but without any success…

I do not have any Auto Route Naming, and nat have a non standard configuration.

That is my Configuration.

public override void Configure(Container container)
        {

            SetConfig(new HostConfig
            {
                HandlerFactoryPath = "eqapi/v1"
            });
            //Config examples
            //this.Plugins.Add(new PostmanFeature());
            /*this.Plugins.Add(new CorsFeature(allowedOrigins: "*",
                    allowedMethods: "GET, POST, PUT, DELETE, OPTIONS",
                    allowedHeaders: "Content-Type",
                    allowCredentials: true));*/
            //JsConfig.IncludePublicFields = true;          Deserializationda fieldları da dahil etmek için
            JsConfig.DateHandler = DateHandler.ISO8601;
            this.Plugins.Add(new CorsFeature());
            this.PreRequestFilters.Add((httpReq, httpRes) => {
                //Handles Request and closes Responses after emitting global HTTP Headers
                var req = httpReq as ServiceStack.Host.AspNet.AspNetRequest;
                if (req.HttpMethod == "OPTIONS")
                    httpRes.EndRequest(); //add a 'using ServiceStack;'
            });

            Plugins.Add(new SwaggerFeature());

            Plugins.Add(new AuthFeature(() => new AuthUserSession(),
              new IAuthProvider[] {
                new BasicAuthProvider(), //Sign-in with HTTP Basic Auth
                new CredentialsAuthProvider(), //HTML Form post of UserName/Password credentials
              }));

            Plugins.Add(new RegistrationFeature());

            container.Register<ICacheClient>(new MemoryCacheClient());
            var userRep = new InMemoryAuthRepository();
            container.Register<IUserAuthRepository>(userRep);

            //The IUserAuthRepository is used to store the user credentials etc.
            //Implement this interface to adjust it to your app's data storage
            
        }

The problem with Request name is not a big situation. I can handle this.
But if it will be problem for another case in SS, OrmLite or Redis… it won’t be good.

Note: My system language is Turkish and as you know we have “i” and “ı” which are different, and capitalized ones are “İ” and “I” which are different.

Can you post your request for class definition as text?maybe the issue is due to non ASCII chars used.

Of course, here is the request class;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ServiceStack;
using System.Net.Http;
using static EsneqEngine.Model.Design;

namespace EsneqSS.ServiceModel
{
    [Route("/code", "post", Summary = @"Intellisense desteği sunar",
                Notes = "")]
    public class AutoComplete : IReturn<StringListResponse>
    {
        public int objectId { get; set; }
        public int line { get; set; }
        public int col { get; set; }
        public string code { get; set; }
    }
    [Route("/code/object", "GET", Summary = @"Objenin adından objeyi döner",
                Notes = "")]
    public class ObjectId : IReturn<ObjectDesignResponse>
    {
        public string objectName { get; set; }
    }
    [Route("/code/execute", "get", Summary = @"Objeyi çalıştırır",
                Notes = "")]
    public class Execute : IReturn<StringListResponse>
    {
        public string objectName { get; set; }
        public string args { get; set; }
    }

    public class StringListResponse
    {
        public List<string> data { get; set; }
    }
    public class StringResponse
    {
        public string data { get; set; }
    }
    public class ObjectDesignResponse
    {
        public ObjectDesign data { get; set; }
    }
}

Only non ASCII chars are the string constants, and only problem when I use the capital I character in any request class name.

I’ve updated the existing ObjectId Services with these classes, but still can’t reproduce the issue. Links on the metadata page still show up as expected. Will need a stand-alone repro (GitHub) to be able to continue investigating further.