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

Clarify how to describe HTTP status #191

Open
angelo-v opened this issue May 6, 2019 · 7 comments
Open

Clarify how to describe HTTP status #191

angelo-v opened this issue May 6, 2019 · 7 comments

Comments

@angelo-v
Copy link

angelo-v commented May 6, 2019

Description

Hydra Core Vocabulary has serveral terms / types to express status:

hydra:statusCode
hydra:possibleStatus
hydra:Status

Unfortunately the spec does not provide usage examples or prose explanation of how to use it and there are serveral (conflicting or obsolete) examples in the wild.

The spec should explain how to use those.

My usage understanding from the vocabulary is:

"possibleStatus": [
  {
    "@type": "Status",
    "statusCode": 201,
    "description": "If the resource was created successfully."
  }
]
@alien-mcl
Copy link
Member

Glad we've added some range/domain details. It seems your understanding is OK. There can be a possibleStatus of type Status that can have a property of statusCode. This is to allow de-referencing statuses by the client instead of raw literal.

I'll try to create a proper spec snippet for that

@tpluscode
Copy link
Contributor

What is the practical application other than purely informational?

@angelo-v
Copy link
Author

angelo-v commented May 7, 2019

What is the practical application other than purely informational?

Valid questions. Seems to be targeted on human understanding. Don't know what a machine would do with this.

@tpluscode
Copy link
Contributor

I never fully understood this. It has been suggested that it could be (incorrectly) used to generate client code (compare with #32). @RubenVerborgh @lanthaler ?

At any rate, I agree to document this in the current state which everyone has already agreed on.

@alien-mcl
Copy link
Member

alien-mcl commented May 7, 2019

These kind of constructs makes it easier to prepare some automated tests. Knowing what a operation can return allows you prepare some assertions. Also human readable docs is something we cannot ignore if we think about adoption with big players. When a project begins, one of the first questions from higher managers is 'Where are some docs I can take a look at'?

@tpluscode
Copy link
Contributor

Haha, yes, the manager remark made my day. Human readability should not be neglected either, I agree on that.

But I especially like the idea to put it to use in automatic testing. I do not have a clear idea how exactly it would pan out but it's an intriguing thought.

Any ideas how (rather, where) we could track such ideas? A new repo maybe for a testing tool, or recommendations for testing. Or maybe the cookbook is good enough to document such ideas while we don't have concrete implementation coming?

@alien-mcl
Copy link
Member

Any ideas how (rather, where) we could track such ideas? A new repo maybe for a testing tool,
or recommendations for testing. Or maybe the cookbook is good enough to document such
ideas while we don't have concrete implementation coming?

The cookbook repo sounds interesting. Maybe in future we could have more tools within HydraCG, but i expect them to have separate repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants