-
Notifications
You must be signed in to change notification settings - Fork 130
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
Open API to Hydra Parser #149
Comments
NOTE: In the beginning it is possible to start with a Hydra ApiDoc >> OpenAPI parser if it is an easier way |
@Mec-iS could you elaborate on the Hydra ApiDoc >> OpenAPI parser. So you want to implement a parser that converts a Hydra ApiDoc to an OpenAPI? I have tried writing python classes to parse OpenAPI. I am stuck at the schema object in OpenAPI. Trying to figure out a way to represent schema objects (that are returned and requested) as python objects. |
Probably it is too difficult for now to code a parser OpenAPI->ApiDoc. Instead doing an ApiDoc->OpenAPI one may be doable. |
Okay. Any suggestions on how to start? @Mec-iS The easiest approach i see is printing the OpenAPI doc directly from the hydrus classes. |
Exactly.
|
A get request on {
"@context": "/serverapi/contexts/dummyClassCollection.jsonld",
"@id": "/serverapi/dummyClassCollection/",
"@type": "dummyClassCollection",
"members": [
{
"@id": "/serverapi/dummyClassCollection/1",
"@type": "dummyClass"
}
]
} However, there is no way to access the {
"message": "The method is not allowed for the requested URL."
} Shouldn't the first get method return a list of I am trying to convert the |
Actually this was done to make the server similar to Markus's issues API. You can check it out on his website. You could return IDs to access each instance separately or give a list of instances, both are possible but we went ahead with the former. As for the error message, better if you open an issue about it. |
@suryatejreddy The reason for an Hyperlinked API (API supporting Hypermedia) is that some of the endpoints can return links to other resources instead of plain data. Collections as you have described them are implemented to return only hypermedia, leaving to the client the possibility of going and fetching the full object with the properties. (This is also how the Github API works, take a look for some examples). |
@Mec-iS the Open Api documentation that has to be imported and converted to Hydra API documentation has to be given in YAML/JSON or both ? What would be the best approach ? |
This is not a big difference as YAML can be easily re-serialized into JSON. Start with JSON that is closer to JSON-LD. |
Added to #193 |
I'm submitting a
To implement this, we can use existing Hydrus classes to create objects from the Open API doc. The following workflow was recommended by @Mec-iS .
OpenAPI YAML -> hydrus classes -> HYDRA ApiDoc
I am currently working on porting the basic HYDRA functionalities (GET, PUT, POST methods; classes, collections)
More suggestions are welcome.
Do you want to work on this issue?
yes
The text was updated successfully, but these errors were encountered: