This repository demonstrates multiple OpenAPI code generation tools for the pyDataverse API. Based on an OpenAPI specification drawn from from Dataverse 5.14 ednpoint /openapi
all paths that are utilized in pyDataverse's NativeAPI
have been extracted and utilized to generate client side code. Due to missing request bodies and responses in the OpenAPI specifications, the generated code is far from optimal. However, it is a good starting point for further development and highlights the differences between the code generation tools.
[!IMPORTANT] These are all the relevant files and their descriptions:
pydataverse_openapi_schema.yaml
- Contains the OpenAPI specification for the pyDataverse NativeAPIpydataverse_nativeapi_paths.txt
- Collection of paths in pyDataverse's NativeAPIdataverse_5_14_openapi_schema.yaml
- Contains the OpenAPI specification for Dataverse 5.14openapi_generator
- Contains the generated code from OpenAPI Generatorspeakeasy
- Contains the generated code from Speakeasygenerate.sh
- Script to generate the code from the OpenAPI specificationgen.yaml
- Configuration file for Speakeasy
api/v1/datasets
POST request for dataset creation/api/v1/dataverses/{identifier}/roles
/api/v1/roles
/api/v1/files/{id}/metadata
versionId
is expected within the path, but is not includedsome/path/{id}:
get:
summary: Get a specific object
description: Get a specific object
operationId: getSpecificObject
security:
- ApiKeyAuth:
type: apiKey
in: header
name: X-Dataverse-key
parameters: ...
responses: ...
Below is a list of SDKs that have been generated based on pyDataverse's OAI spec:
Below is a list of SDKs that have been generated based on pyDataverse's OAI spec:
dataclasses
and thus less dependent on third-party libs