Skip to content

Commit f5aa0c2

Browse files
JoleVLFJoleVLF
andauthored
API Readme update (#26)
* Readme update * Update swagger and readme * URL fix * Update docs --------- Co-authored-by: JoleVLF <Jovan@DESKTOP-JTIACNO>
1 parent c9d7152 commit f5aa0c2

1 file changed

Lines changed: 52 additions & 10 deletions

File tree

README.md

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,24 @@ docker compose up
5151

5252
The application will be served on http://127.0.0.1:8009 (I.E. typing localhost/docs in your browser will load the swagger documentation)
5353

54+
Full list of APIs available you can check [here](https://editor-next.swagger.io/?url=https://gist.githubusercontent.com/JoleVLF/20645c6e8e3545d02c7c4570271bdc49/raw/6efafb74bd2bc33e4221ee2a202d0c830b867c70/reporting)
5455
# Documentation
5556
<h3>POST</h3>
5657

5758
```
5859
/api/v1/openagri-report/irrigation-report/
5960
```
6061

62+
## Request Params
63+
64+
### data
65+
- **Type**: `UploadFile`
66+
- **Description**: API processes the data directly to generate the report if data passed. This parameter is not required and when it is, must be provided as an `UploadFile`.
67+
68+
69+
70+
## Response
71+
6172
Response is generated PDF file.
6273

6374

@@ -67,10 +78,24 @@ Response is generated PDF file.
6778
/api/v1/openagri-report/compost-report/
6879
```
6980

70-
Response is generated PDF file.
71-
Possible observation_type_name values = \
72-
["Pesticides", "Irrigation", "Fertilization", "CropStressIndicator", "CropGrowthObservation"]
81+
## Request Params
82+
83+
### observation_type_name
84+
- **Type**: `str`
85+
- **Description**: The name of the observation type for the report. The value of this parameter must be one of the following options:
86+
- "Pesticides"
87+
- "Irrigation"
88+
- "Fertilization"
89+
- "CropStressIndicator"
90+
- "CropGrowthObservation"
7391

92+
### data
93+
- **Type**: `UploadFile`
94+
- **Description**: API processes the data directly to generate the report if data is passed. This parameter is not required and when it is, must be provided as an `UploadFile`.
95+
96+
97+
## Response
98+
Response is generated PDF file.
7499

75100
<h3> Example usage </h3>
76101

@@ -85,15 +110,28 @@ When service is run wihtout Gatekeeper data must be provided in .json file forma
85110

86111
```
87112

88-
Response: A generated PDF file containing the animal report.
113+
## Request Params
114+
115+
### animal_group
116+
- **Type**: `Optional[str]`
117+
- **Description**: The group or category the animal belongs to. This is an optional string field, and it can be left as `None` if not applicable.
118+
119+
### name
120+
- **Type**: `Optional[str]`
121+
- **Description**: The name of the animal. It is an optional string field, and if no name is provided, it can be set to `None`.
122+
123+
### parcel
124+
- **Type**: `Optional[UUID4]`
125+
- **Description**: A unique identifier for a parcel, represented as a UUID4. This is an optional field that can be left empty if not required.
89126

90-
Possible query parameters:
127+
### status
128+
- **Type**: `Optional[int]`
129+
- **Description**: The status code associated with the animal or the transaction. It is an optional integer field. If not specified, it defaults to `None`.
130+
131+
### data
132+
- **Type**: `UploadFile`
133+
- **Description**: API processes the data directly to generate the report if data passed. This parameter is not required and when it is, must be provided as an `UploadFile`.
91134

92-
animal_group (Optional, string): Specifies the group of animals to include in the report.
93-
name (Optional, string): Filters results by animal name.
94-
parcel (Optional, UUID4): Identifies the specific parcel where the animals are located.
95-
status (Optional, integer): Filters animals by their status.
96-
Example Usage
97135
The Animal Report API can be used with or without Gatekeeper support:
98136

99137
With Gatekeeper: The data file parameter can be ignored.
@@ -102,6 +140,10 @@ If no data file is provided and Gatekeeper is not enabled, the API fetches data
102140

103141
If a valid JSON file is uploaded, the API processes the data directly to generate the report
104142

143+
## Response
144+
145+
Response is generated PDF file.
146+
105147
<h2>Pytest</h2>
106148
Pytest can be run on the same machine the service has been deployed to by moving into the tests dir and running:
107149

0 commit comments

Comments
 (0)