Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client generation with required sanitization #2

Merged
merged 6 commits into from
Nov 1, 2024

Conversation

rahul1995
Copy link
Contributor

@rahul1995 rahul1995 commented Oct 24, 2024

Purpose

To create the OpenAPI spec, sanitize it to make compatible with Ballerina OpenAPI tool, and generate Client using it.

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2024

CLA assistant check
All committers have signed the CLA.

@rahul1995 rahul1995 changed the title Prepare the OpenAPI specification Client generation with required sanitization Oct 24, 2024
@lnash94
Copy link
Member

lnash94 commented Oct 25, 2024

@rahul1995 this looks good 😃!, We will review it. In the meantime Shall we add the dropbox icon (PNG format) for the connector and change the path in the relevant details in the Ballerina.toml (located in /build-config/resources/Ballerina.toml) here? You can place the icon.png in the Ballerina folder.

you can refer this example : https://github.com/ballerina-platform/module-ballerinax-docusign.dsclick/blob/main/build-config/resources/Ballerina.toml#L9

docs/spec/sanitations.md Outdated Show resolved Hide resolved
docs/spec/openapi.yaml Outdated Show resolved Hide resolved
rahul1995 and others added 2 commits October 25, 2024 18:12
Co-authored-by: Sumudu Nissanka <lnash94@users.noreply.github.com>
@rahul1995 rahul1995 requested a review from lnash94 October 25, 2024 18:41
@rahul1995
Copy link
Contributor Author

@lnash94 Thanks for the review. Made the changes requested and added the icon.

@rahul1995
Copy link
Contributor Author

@lnash94 Dropbox does not provide an official OpenAPI spec. So I actually used their Postman API collections and generated the OpenAPI yaml using https://p2o.defcon007.com/.
I am not sure how reliable it is, but it was giving a lot of compatibility issues with Ballerina OpenAPI tool such as null fields.

I found another way to generate OpenAPI spec from Postman collection which is provided officially by Postman team themselves. - Postman Transformers

It's working nicely. so I have created another PR for Client generation - #3
Could you please review that PR instead? Thanks!
-cc @Nuvindu

@lnash94
Copy link
Member

lnash94 commented Oct 28, 2024

@lnash94 Dropbox does not provide an official OpenAPI spec. So I actually used their Postman API collections and generated the OpenAPI yaml using https://p2o.defcon007.com/. I am not sure how reliable it is, but it was giving a lot of compatibility issues with Ballerina OpenAPI tool such as null fields.

I found another way to generate OpenAPI spec from Postman collection which is provided officially by Postman team themselves. - Postman Transformers

It's working nicely. so I have created another PR for Client generation - #3 Could you please review that PR instead? Thanks! -cc @Nuvindu

Yeah @rahul1995, I also noticed that this YAML is missing many payload fields documented on their official site. Since we are in category 02 connector generation, we recommend writing the OpenAPI spec on your own, following the standard Swagger spec, since the Ballerina OpenAPI tool supports the standard OpenAPI specification.

It is totally fine to have support from third-party tools to write your own spec for the given connector. At the same time, please make sure those generated OpenAPI specs have all the details which align with the original API documentation provided by the vendor. If something is missing there, you can modify the generated spec and use it.

Yeah, your second generated approach is more impressive than the first approach; it has details. Let me review it ☺️. In the meantime, you can check that your OpenAPI spec and API documentation have similar details, and if something is missing there, please modify it.

@lnash94 lnash94 merged commit b2897a1 into ballerina-platform:main Nov 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants