thoth-station / amun-client

A library for communicating with Amun API
GNU General Public License v3.0
2 stars 6 forks source link

Unify URLs to the service in the generated output #138

Closed fridex closed 4 years ago

fridex commented 4 years ago

Is your feature request related to a problem? Please describe.

See for exammple this PR #137. Files carry URL to the service:

All URIs are relative to *http://amun-api-thoth-test-core.apps.ocp.prod.psi.redhat.com/api/v1*

It would be nice to add logic to the generate script that automatically replaces all URLs in this text to generic, e.g. http://amun.test.thoth-station.ninja/api/v1.

bissenbay commented 4 years ago

@fridex What if I just replace that http://amun-api-thoth-test-core.apps.ocp.prod.psi.redhat.com/api/v1 back to http://amun.test.thoth-station.ninja/api/v1 and regenerate, I think http://amun.test.thoth-station.ninja/api/v1 is working now, WDYT?

fridex commented 4 years ago

It's pointing to old deployment (as of now) so the generated schema might be not up to date. Having the replacement logic could be nice also for use-cases when we generate the client from openapi stored in a local directory (or from another deployment).

bissenbay commented 4 years ago

@fridex I don't understand what needs to be done here.

fridex commented 4 years ago

@fridex I don't understand what needs to be done here.

In all the files that are automatically generated, replace the link to the original URL or path to openapi.yaml spec used with a generic string http://amun.test.thoth-station.ninja/api/v1.

So strings in the code like:

All URIs are relative to http://amun-api-thoth-test-core.apps.ocp.prod.psi.redhat.com/api/v1

Will always be

All URIs are relative to http://amun.test.thoth-station.ninja/api/v1

At the end of openapi-codegen.sh:

https://github.com/thoth-station/amun-client/blob/25073f15554fc33c8c78341138427f3d18bf1003/openapi-codegen.sh#L43

goern commented 4 years ago

is this still valid?