yndlingsfar / serverless-openapi-integration-helper

The plugin separates x-amazon-apigateway extension syntax from your openapi3 files
MIT License
6 stars 5 forks source link

Vague filenames of generated integrations #11

Open henhal opened 2 years ago

henhal commented 2 years ago

When generating integrations, each path generates a separate file, called +.yml. Currently my integrations directory looks like this:

1649255895975104.yml
1649255895976110.yml    
164933241670879.yml

And it's not very clear... Is there a reason for this? Couldn't the files be named <path>.yml - but with slashes transformed into underscores (and the leading slash removed), or something like that? This would make it more intuitive.

paths:
  /foo: # generates foo.yml
    ...
  /foo/bar # generates foo_bar.yml
    ...

Possibly an even better approach would be to generate one file per operation, not one per path, so that they could be named:

getPet.yml
addPet.yml
listPets.yml

Wouldn't this still be possible to deep merge correctly - the x-amazon-apigateway-integration objects are placed inside each operation anyway, right?

Yet another approach could be to generate all integrations into a single file?

If any of this is of interest, I could raise a PR if that's accepted.

yndlingsfar commented 2 years ago

Hey, good hint. A PR would be much appreciated