GithubHelp home page GithubHelp logo

IField.Is bug? about hypermedia HOT 5 CLOSED

cosullivan avatar cosullivan commented on July 1, 2024
IField.Is bug?

from hypermedia.

Comments (5)

gdarussian avatar gdarussian commented on July 1, 2024

Actually both of those ways seem to have other issues. What works for me is making the default be Serializable | Deserializable

from hypermedia.

cosullivan avatar cosullivan commented on July 1, 2024

Hi @gdarussian,

Are you able to send me an example of where you are seeing the issue?

Thanks,
Cain

from hypermedia.

gdarussian avatar gdarussian commented on July 1, 2024
        private static async Task<List<FteRequirements>> readAsync()
        {
            ResourceInflector.KnownPlurals.Add("fterequirements", "fterequirements");
            var strData = "{\"data\":[{\"type\":\"fterequirements\",\"id\":\"-1\",\"attributes\":{\"queueID\":1921,\"seriesValues\":[0.0,0.0,7.0,7.0,7.0,7.0,7.0,7.0],\"endDate\":\"2014-09-14T07:00:00.000Z\",\"id\":-1,\"startDate\":\"2014-08-31T07:00:00.000Z\"},\"links\":{\"self\":\"http://localhost:7001/json-api/fterequirements/-1\"}}],\"included\":[]}";
            var httpContent = new ByteArrayContent(strData.Select(c => (byte)c).ToArray());
            var data = await httpContent.ReadAsJsonApiManyAsync<FteRequirements>();
            Debug.Print(data.First().ToString());
            return data;
        }
        public class FteRequirements 
        {
            public int Id { get; set; }
            public int QueueId { get; set; }
            public int[] SeriesValues { get; set; }
            public DateTime StartDate { get; set; }
            public DateTime EndDate { get; set; }

            public override string ToString()
            {
                string data = SeriesValues == null ? "(null)" : SeriesValues.Aggregate("", (acc, i) => i + ", " + acc);
                return string.Format("[{0}] SPQ{1}, {2} - {3}: {4}", Id, QueueId, StartDate, EndDate, data);
            }
        }

By default, it shows all default fields. Changing RuntimeField.CreateDefaultOptions makes it work:

            var options = FieldOptions.Serializable | FieldOptions.Deserializable;
            //var options = FieldOptions.None;

from hypermedia.

cosullivan avatar cosullivan commented on July 1, 2024

Ok, I think the latest commit should fix it;

Let me know if that works for you?

from hypermedia.

gdarussian avatar gdarussian commented on July 1, 2024

Looks good, thanks.

from hypermedia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.