Skip to content

Observations on type primitives #5

@webron

Description

@webron

Issue by quasipedia from Sunday Mar 02, 2014 at 00:16 GMT
Originally opened as https://github.com/wordnik/swagger-docs/issues/2


While I understand the present specification is an attempt at documenting how swagger works today, I thought the following observations could be of some use at least for discussion / version 1.3.

number

The JSON schema specification says for this primitive:

Any JSON number. Number includes integer.

This possibly means that number should also have the int32 and int64 formats available (as they are valid), and that eventually the integer type could be killed altogether.

date & date-time

In my opinion these are not formats. A format would be ISO 8601 (which specifies both date and date-time), for example. Mixing date and date-time with int32 and int64 is however IMO mixing oranges and apples: the former define the semantics of the string, the latter their boundaries.

In general

I believe this section may be a candidate for review: since in JSON the number is encoded as its human-readable representation, there is no need to attach information about the number of bits or the signed/unsigned property.

If the thought was to provide the client with information about the boundaries of the values, this would be better achieved with explicit maximum and minimum fields (and possibly with a resolution one, telling what is the last significant digit of a result (a far more interesting/useful property to know, in math applications).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions