Git Product home page Git Product logo

Comments (5)

na2hiro avatar na2hiro commented on August 30, 2024 1

It means it's omitted like {}, which is similar to TypeScript's ?.

from json-kifu-format.

na2hiro avatar na2hiro commented on August 30, 2024 1

Hmm, that's a good catch. I guess I didn't really pay attention to null vs undefined and wrote the jkf player.

So let me update the answer: I intended to be "lacking value", but null is acceptable if we consider the spec partially consists of jkf player too.

Options for the schema:

  • Disallow null for the from field and make these files invalid
    • I want to avoid this to reject possibly generated JKF files for last several years
  • Allow null along with missing value for from field (and other fields if we find ones), and note that it's a historical reason
  • Allow null for all the fields annotated with ?

I'm not sure if which one of second of third is the best

from json-kifu-format.

na2hiro avatar na2hiro commented on August 30, 2024 1

I see, makes sense. Let's go with the third option

from json-kifu-format.

gemmaro avatar gemmaro commented on August 30, 2024

While fixing draft JSON Schema file (#51 ), following error occured to specification/files/ryuou201409020101.jkf.json (which is symlinked from test/files/jkf/ryuou201409020101.jkf for this constraint):

specification/files/ryuou201409020101.jkf.json invalid
[
  {
    instancePath: '/moves/44/move/from',
    schemaPath: '#/$defs/placeFormat/type',
    keyword: 'type',
    params: { type: 'object' },
    message: 'must be object'
  }
]

where

$ jq '.moves[44].move.from' specification/files/ryuou201409020101.jkf.json
null

According to your comment above, the existing JKF files (and possibly serializer, since it seems that they are generated automatically) is against the specification, I think.

from json-kifu-format.

gemmaro avatar gemmaro commented on August 30, 2024

In terms of JSON Schema, all options are possible 👍
Based on the current game record files, the third option seems to be a good choice. (Since the both notations has almost same semantics for humans.)

from json-kifu-format.

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.