Skip to content

Commit e376183

Browse files
author
Orkun
authored
feat(MINOR): add contributing guideline & sync (#27)
1 parent 44b691b commit e376183

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

contributing.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to Fingerprint Pro Server API SDK
2+
3+
## Structure
4+
5+
Most files in the project are autogenerated by [swagger-codegen](https://swagger.io/tools/swagger-codegen/) for php.
6+
7+
- [template](./template) - folder contains redefined templates of `swagger-codegen`. Original templates you can find in [swagger-codegen repo](https://github.com/swagger-api/swagger-codegen/tree/751e59df060b1c3ecf54921e104f2086dfa9f820/modules/swagger-codegen/src/main/resources/php).
8+
- [docs](./docs) - generated documentation for models and [API Client](./docs/Api/FingerprintApi.md).
9+
- [src](./src) - API Client code is generated automatically.
10+
11+
## Code generation
12+
13+
You need `swagger-codegen` to run code generation. There are many ways described in the [readme](https://github.com/swagger-api/swagger-codegen).
14+
In the project we use local jar file `bin/swagger-codegen-cli.jar`.
15+
16+
You can just run `sh ./scripts/generate.sh` script and it will do all the work.
17+
18+
To download fresh OpenAPI schema run `sh ./scripts/sync.sh`
19+
20+
### Configuration
21+
22+
Project configuration is described in `config.json` file. To read about available parameters run the command below:
23+
24+
```shell
25+
java -jar ./bin/swagger-codegen-cli.jar config-help -l php
26+
```

scripts/sync.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
curl -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemes/fingerprint-server-api.yaml
4+
5+
examplesList=(
6+
'visits_limit_500.json'
7+
'get_event.json'
8+
)
9+
10+
for example in ${examplesList[*]}; do
11+
curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example"
12+
done
13+
14+
./scripts/generate.sh

0 commit comments

Comments
 (0)