disneystreaming / smithy4s

https://disneystreaming.github.io/smithy4s/
Other
341 stars 69 forks source link

sbt plugin: allow configuring openapi spec generation #1478

Open yoohaemin opened 3 months ago

yoohaemin commented 3 months ago

I have a problem that is solved by calling jsonAdd on openapi generation. It’s the same as this: https://github.com/smithy-lang/smithy/issues/834

It’s easy if I can control the arguments passed to the following method:

https://github.com/disneystreaming/alloy/blob/fd6b8b067b69e3033c288bb665de8054108bf747/modules/openapi/src/alloy/openapi/package.scala#L33

However, the current sbt plugin doesn’t provide a way to configure this; it simply calls the generate method that doesn’t take any configuration arguments:

https://github.com/disneystreaming/smithy4s/blob/ee9abfb9430879eeabc18dd9edab188f7b32c03d/modules/codegen/src/smithy4s/codegen/internals/CodegenImpl.scala#L67

Would it be possible that the sbt plugin expose a key to transform this configuration?

In the meantime, because it’s quite difficult to modify the build process from our sbt build, I am thinking of re-parsing and transform the outputted json...

Baccata commented 3 months ago

In a very timely fashion, @astridej and I have been discussing at how to best solve this.

Can't guarantee a timeframe but it's being looked at.

yisraelU commented 3 months ago

had a similar such desire to add a server list. TY