Git Product home page Git Product logo

Comments (6)

devesmee avatar devesmee commented on July 17, 2024 1

Swift (iOS) and Kotlin (Android) can easily handle optional properties, but I am not sure about any other programming languages that people are using in combination with this API and how those languages handle optionals. It wouldn't be good if other peoples 'existing apps/websites break because of using a null-value, but personally I would prefer using null so you can keep yearOfBirth as an Int and wand length as a Double instead of using a String.

But really it is up to you, I can make it work with a String also :)

from hp-api.

devesmee avatar devesmee commented on July 17, 2024 1

@KostaSav
Works perfectly fine! Somehow Swift takes an Int value and automatically converts it to a Double, so that change is not needed.
Thanks for your help!

from hp-api.

KostaSav avatar KostaSav commented on July 17, 2024

Hi @devesmee ,
No, there is not a specific reasoning. These are probably bugs that need to be resolved and agree on a specific datatype for each field.
You can open a pull request for any inconsistencies you find and fix. Otherwise, I will have a look as well when I have the chance.

from hp-api.

devesmee avatar devesmee commented on July 17, 2024

Hi @KostaSav,
Would you like both of them to be a String and then an empty String when there is no value?
Or the yearOfBirth as an Int, the wand length as a Double and then a null value when no value is known?

from hp-api.

KostaSav avatar KostaSav commented on July 17, 2024

I am not sure, thinking about it.
What do you thing would be the best approach @devesmee? What would be easier/most effective for your iOS app and perhaps for other apps using this API?

from hp-api.

KostaSav avatar KostaSav commented on July 17, 2024

@devesmee
I have changed to null values for missing yearOfBirth and wand length. Please check if it's OK now.

About the integer/double values for wand length, I am not sure if that also causes issues. If it does, a JSON schema needs to be created with the datatypes of each field.

from hp-api.

Related Issues (14)

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.