Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite doc to follow standard format #441

Merged
merged 9 commits into from
Jul 10, 2024

Conversation

kmoscoe
Copy link
Contributor

@kmoscoe kmoscoe commented Jul 8, 2024

No description provided.

@kmoscoe
Copy link
Contributor Author

kmoscoe commented Jul 8, 2024

This PR rewrites observation.md to follow the standard format of the other API docs, as specified in https://github.com/datacommonsorg/docsite/blob/master/api/rest/v1/_rest_api_template.md. This includes:

  • Adds request and response sections, with code skeletons
  • GET and POST skeletons
  • Adds query parameters tables

It also:

  • Adds a new section that explains how to look up date-time formats, with images
  • Reorders the parameters for clarify
  • Fixes some problems with examples that didn't have escape characters
  • Fixes some response examples

Staged at bullie.svl.corp.google.com:4000

@kmoscoe kmoscoe requested a review from chejennifer July 8, 2024 22:12
Copy link
Contributor

@chejennifer chejennifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

api/rest/v2/observation.md Show resolved Hide resolved
| key <br /> <required-tag>Required</required-tag> | string | Your API key. See the [page on authentication](/api/rest/v2/getting_started.html#authentication) for a demo key, as well as instructions on how to get your own key. |
| date <br /> <required-tag>Required</required-tag> | string | See [below](#date-string) for allowable values. |
| variable.dcids <br /> <required-tag>Required</required-tag>| list of strings | List of [DCIDs](/glossary.html#dcid) for the statistical variable to be queried. |
| entity.dcids | list of strings | Comma-separated list of [DCIDs](/glossary.html#dcid) of entities to query. At least one of `entity.dcids` or `entity.expression` is required. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of At least one of entity.dcids or entity.expression is required, should it be One of entity.dcids or entity.expression is required? because I don't think we can have both, can we?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you can, as described later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting, where is this described?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, I mixed this up with the select stuff. D'oh! It seemed like it should work (like I want the person count for Pittsburgh and all cities contained in California), but I just tried it and you're right, it doesn't actually work. It's not rejected as an invalid query, but entity.dcids seems to always take precedence (I tested using 2 orders). Do you think this is intended behavior or a bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've always assumed you can only do one or the other, but I'm not sure if that was the intention ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so for now, I've corrected the text with the current behavior. When Bo gets back I'll try to remember to ask him if this is intended behavior. (Ideally it seems to me that you should be able to combine them, as you can have multiple entity.dcids)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sounds good to me

api/rest/v2/observation.md Outdated Show resolved Hide resolved
api/rest/v2/observation.md Outdated Show resolved Hide resolved
api/rest/v2/observation.md Show resolved Hide resolved
Copy link
Contributor

@chejennifer chejennifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the updates!

@kmoscoe kmoscoe merged commit bec5ab7 into datacommonsorg:master Jul 10, 2024
1 check passed
@kmoscoe kmoscoe deleted the observation_rewrite branch July 10, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants