cdklabs / cdk-verified-permissions

Amazon Verified Permissions L2 CDK Constructs
Apache License 2.0
17 stars 2 forks source link

proposal: schemaFromRestApi Method #220

Closed joshkraft closed 4 days ago

joshkraft commented 3 weeks ago

Hi team,

It would be great to be able to generate a schema based off of CloudFormation templates, rather than having to deploy the API, export a swagger spec, and then generate based off of that.

What do you think of a new method schemaFromCloudFormationTemplate()?. I am thinking it would work exactly like schemaFromOpenApiSpec(), just with a different source.

If this aligns with the project’s direction, I’d be happy to make a contribution.

andreameroni commented 3 weeks ago

Hi @joshkraft, thanks for your proposal and your contribution!

Let me discuss it with the team and come back to you

andreameroni commented 2 weeks ago

Hi @joshkraft,

We discussed your proposal internally and would like to hear more about your use case, specifically about the need to generate a schema from a CloudFormation template

Rather than parsing the template and generate a schema, which would imply several assumptions (e.g. no more than 1 API per template), we suggest to implement a functionality that generates the schema from another CDK construct e.g. Rest API

Also, for users that want/need to start from a CloudFormation template the suggested way would be to import it in CDK

What do you think?

joshkraft commented 2 weeks ago

Hi Andrea - thanks for the response. I think working with the RestApi construct would work for our use case. Would you be open to a contribution that adds something like schemaFromRestApi to this project?

andreameroni commented 2 weeks ago

Hi Josh,

Yes definitely - I think it will align nicely with our design!

Feel free to submit a PR, thank you very much