GithubHelp home page GithubHelp logo

Comments (7)

fergcb avatar fergcb commented on August 12, 2024 1

An update to these docs would be welcome in tandem with an update to the actual structure of the data, I think.

It would be nice to separate the APIReference from the objects, as below, and update the docs accordingly.

"ability_bonuses": [
  {
    "ability_score": {
      "name": "WIS",
      "index": "wis",
      "url": "/api/ability-scores/wis"
    },
    "bonus": 1
  }
],

from 5e-srd-api.

bagelbits avatar bagelbits commented on August 12, 2024

I think that makes the most sense. I know we've been wanting to move away from APIReference containing additional data besides just a glorified link.

from 5e-srd-api.

ecshreve avatar ecshreve commented on August 12, 2024

Oh very interesting, I'll take a look at this. Should be a fun first code (not docs) change :)

from 5e-srd-api.

ecshreve avatar ecshreve commented on August 12, 2024

dropping this here in case it's useful in the future, one liner to hit local api and pretty print a single field:

curl http://localhost:3000/api/races/dragonborn | python -c 'import sys, json, pprint; pprint.pprint(json.load(sys.stdin)["ability_bonuses"])'

from 5e-srd-api.

bagelbits avatar bagelbits commented on August 12, 2024

That's lovely! I really need to get GraphQL up and running properly though. I think in GraphQL, it's just:

query {
  race(query: {name:"Dragonborn"}) {
    ability_bonuses {
      bonus
      index
      name
      url
    }
  }
}

from 5e-srd-api.

ecshreve avatar ecshreve commented on August 12, 2024

That looks right to me, I deal with a log of gql/json data at work and wrote this mostly functional json to csv converter a couple months ago https://github.com/ecshreve/jcgo

from 5e-srd-api.

bagelbits avatar bagelbits commented on August 12, 2024

Closing as this has been merged in!

from 5e-srd-api.

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.