datadotworld / data.world-py

Python package for data.world
https://data.world/integrations/python
Apache License 2.0
102 stars 28 forks source link

Create a contributors guide #57

Closed hardworkingcoder closed 6 years ago

hardworkingcoder commented 7 years ago

Similar to https://github.com/datadotworld/dwapi-spec/blob/master/CONTRIBUTING.md please.

hardworkingcoder commented 7 years ago

Notes I have from conversation:

A large portion of that is automated. This is typically a 3 step process:

  1. Refresh https://github.com/datadotworld/data.world-py/blob/master/datadotworld/client/swagger-dwapi-def.json from https://api.data.world/v0/swagger.json
  2. Re-generate the _swagger package using codegen (see: https://github.com/datadotworld/data.world-py/blob/master/datadotworld/client/.swagger-codegen-ignore#L18, for instruction)
  3. Update https://github.com/datadotworld/data.world-py/blob/master/datadotworld/client/api.py as needed, prioritizing backwards-compatibility

With respect to #2, you have to use a tool called swagger-codegen: https://github.com/swagger-api/swagger-codegen (it will automatically generate all the code you see in _swagger). GitHub swagger-api/swagger-codegen swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.

hardworkingcoder commented 7 years ago

I installed Swagger-codegen by doing the following wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.2.3/swagger-codegen-cli-2.2.3.jar -O swagger-codegen-cli.jar sudo apt-get install default-jre java -jar swagger-codegen-cli.jar help

hardworkingcoder commented 7 years ago

For step #1 go to https://api.data.world/v0/swagger.json and run it through some prettier and just replace https://github.com/datadotworld/data.world-py/blob/master/datadotworld/client/swagger-dwapi-def.json with it?

hardworkingcoder commented 7 years ago

Use swagger-codegen 2.2.2 https://github.com/swagger-api/swagger-codegen/releases/tag/v2.2.2