onshape-public / onshape-clients

All Onshape clients for interacting with the Onshape API.
MIT License
34 stars 29 forks source link

Metadata Get methods are missing the data response description in openapi.json #57

Open toebes opened 4 years ago

toebes commented 4 years ago

If you look at the openapi.json file for the metadata apis, the get methods don't have a schema for the response: For example looking at

"/api/metadata/d/{did}/{wvm}/{wvmid}/e": {
    "get":{
        "tags": [
          "Metadata"
        ],
        "operationId":"getWMVEsMetadata",
        ..... skip a bunch of lines ....
        "responses": {
            "default": {
                "description": "default response",
                "content": {
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1": {}
                }
            }
        },

You see that the content section is empty after the application

The same is also true for the other Metadata get routines

URI operationId
/api/metadata/d/{did}/{wvm}/{wvmid}/e/{eid} | getWMVEMetadata
/api/metadata/d/{did}/{wvm}/{wvmid}/e/{eid}/p | getWMVEPsMetadata
/api/metadata/d/{did}/{wvm}/{wvmid}/e/{eid}/p/{pid} | getWMVEPMetadata
/api/metadata/d/{did}/{wv}/{wvid} | getWVMetadata
/api/metadata/standardcontent/d/{did}/v/{vid}/e/{eid}/{otype}/{oid}/p/{pid} | getVEOPStandardContentMetadata

In looking through the rest of the file, it certainly will involve a BTPartMetadataInfo and BTMetadataPropertyInfo with a few discriminators.

eak24 commented 4 years ago

Hi @toebes,

Thanks for investigating this. You are absolutely right that the OpenAPI definition is missing some response types. This is because it is still a WIP, and there are many, many APIs to document, so there are still some that we are working through. I will update this ticket when the correct responses are incorporated.

toebes commented 4 years ago

I'm more than happy to help. I've gotten the Metadata ones all implemented and am in the process of testing. If there are any standards to follow, it would be useful to know, but I should be able to push these changes tomorrow into my fork... Then goes the arduous process of the pull request.

eak24 commented 4 years ago

Thank you for the help! The documentation itself is actually generated from our source code using Swagger Core to create the spec so that when the code changes, so does the documentation. So to truly 'fix' this requires changes to the actual Onshape codebase (not just onshape-clients).