- YAML로 결정
- YAML 파일로 한 곳에서 관리하고 여러개의 SDK언어 지원한다
- JSONRPC : id, method, jsonrpc, params
- REST API :
- method : getRewards()
- params : blockNumber Integer
- Array를 인자로 받아서 사용할 것인가?
- use the getRewards(params Array[Integer])
- 단일 파라미터를 선언해서 인자로 받고 Array로 변환 할 것인가?
- use the getRewards(num Integer)
- send the array params: [integer]
- auto increment를 사용할 것인가? (Java, Kotlin)
- 고정 값으로 1을 사용할 것인가?
- yaml(json) spec에서는 method 이름을 API마다 고정을 하고 generated code에서 method 사용할 때는 따로 설정을 하지 않으면 좋겠다
- jsonrpc: 2.0 고정
generator로 만들어진 API는 jsonrpc request를 hidden 처리 할 수 있나?
- usage : getRewards(blockNumber Integer)
- rpc call
- id : auto increment
- method : set to klay_getRewards automatically
- jsonrpc : 2.0
- params : array of integer, [ blockNumber ]
- web3j Request, Response,
Web3jService
사용 - openapi generator가 생성한 코드를 사용할 것인가?
- openapi generator : https://github.com/OpenAPITools/openapi-generator
- swagger codegen : https://github.com/swagger-api/swagger-codegen
- API
- Client
- Model
- RPC call
- java
- javascript
- typescript + axios
- kotlin + retrofit2
- android(kotlin)
- go
- rust
- python
- swift
- solidity(contract)
-
wallet -
account - transaction
-
keystore -
klaytn specific feature - ethereum feature
- coverage
- BDD
- API 추가/변경시에 함께 코딩을 해야 한다
- RPCJSON
- SDK API 문서
- SDK 언어별 사용 예제
- Online API Server 구성(SwaggerUI)
- Copy all template files of the specific language and library
- Patch a snippet codes
https://openapi-generator.tech/docs/generators/
- 서버 운영
- github books 이용
- 같은 yaml 파일에서 서버/태그로 버전 분기
- 새로운 yaml 파일 만들고 전체 복사하기
- To list
- To list
- To List
- To List
- 가장 잘하는 언어로 SDK 만들어 보기
- 만들어 놓은 모든 API들의 Test Case 시나리오를 제시해 주고, API가 잘 동작하는지 테스트케이스를 만들기
- 새로운 Klaytn API를 정의하고 SDK에 추가하고 테스트 해보기
OpenAPI Getting started : github.io
OpenAPI specification : github.io
OpenAPI 3.1.0 specification : github
OpenAPI generator : github
Mustache Manual : github.io
Mustache Template : medium
Mustache turorial : tsmean
JMustache : github
Swagger specification : swagger
Swagger codegen : github
Swagger editor : editor
Swagger codegen handlebar : notes
JSON-RPC specification : specification