Skip to main content
Question

OpenAPI document's have a lot of errors and warnings

  • 30 September 2023
  • 8 replies
  • 96 views

I'm attempting to generate code based on the OpenAPI documents, but I've encountered numerous errors within these documents. For instance, please take a look at a list of issues in the collection.json file on this GitHub gist:

GitHub Gist - Collection.json Issues

These warnings are causing significant obstacles in the process of generating code from the OpenAPI documents.

[54] collection.json:1769:50 at #/paths/~1v2_0~1invoice~1{x-referenceId}/get/responses/500/content/Request to pay not found/examples/default/value

Example value must conform to the schema: type must be object.

1767 | "examples": {
1768 | "default": {
1769 | "value": null
1770 | }
1771 | }

referenced from collection.json:1763:57 at #/paths/~1v2_0~1invoice~1{x-referenceId}/get/responses/500/content/Request to pay not found

Warning was generated by the no-invalid-media-type-examples rule.

I’m i using the right documents ?

Hello.
It is better to first test with the MoMo Sand box before using any code or gist,
i can tell gist is only indicating errors but not actually including a code sample to track what the developer is missing at the time.
The MoMo API has a working Sandbox console to help you out in every aspect.
https://momodeveloper.mtn.com/
Let me also leave you with the playlist below to guide you.
 

 


 


The issue stems from an OpenAPI specification validation tool. It's important to note that the problem lies within the OpenAPI documentation itself, not in the code. To resolve this, you can download the documentation and utilize a lint validator to identify the errors. In this instance, I employed https://redocly.com/docs/cli/.

You can run the lint validator with the following command:

```
redocly lint collection.json
```

This will help you pinpoint and rectify the errors in the specification.


The issue stems from an OpenAPI specification validation tool. It's important to note that the problem lies within the OpenAPI documentation itself, not in the code. To resolve this, you can download the documentation and utilize a lint validator to identify the errors. In this instance, I employed https://redocly.com/docs/cli/.

You can run the lint validator with the following command:

```
redocly lint collection.json
```

This will help you pinpoint and rectify the errors in the specification.

But over 1000 developers have used the same documentation and have successfully integreted the API.
AM talking about the MoMo API Documentation. Any external documentation that is not maintained, i cannot say anything.
My advise is you first use the MoMo API Documentation as provided by MTN and its sandboz, as advised in earlier reactions.


My brother you are confusing the spec documentation with the API documentation here is a link to the spec documentation these are the documents i download from the momodeveloper

Using the link below you can see the specs for each of the Momo product s 
https://github.com/byaruhaf/MoMoOpenAPISpec

 


You can download the spec documentation as seen in the screenshot below:
So This is not an external Document. 

 


I Have tried using both version 3 the YAML and JSON files the results are the same 


You can utilize an online tool such as https://quobix.com/vacuum/  to lint the specification. It's a fast and free online tool to lint open API specification documents.

Here are the results from the collection spec I just downloaded from the momodeveloper portal. 

 

 

 


Reply