Skip to content

Allow integers to be given as inputs to fields that require floats #59

Description

@davemoore-

The score and quality fields in entity models are floats. Currently, zentity strictly requires the inputs of those fields to be floats. If an integer is submitted to one of these fields, zentity will throw a validation exception.

This behavior is too restrictive for some clients. JavaScript's JSON.stringify() serializer will force any number of 0.0 or 1.0 to be serialized as 0 or 1 and there is no easy way around this (cases: here, here).

zentity should allow integers as inputs to float fields, and then convert those fields to floats for its own purposes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions