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

Convert example from Python to Java #1

Merged
merged 3 commits into from
Nov 2, 2021
Merged

Convert example from Python to Java #1

merged 3 commits into from
Nov 2, 2021

Conversation

johnboyes
Copy link
Contributor

@johnboyes johnboyes commented Nov 2, 2021

This repo now uses a Java client SDK, rather than
the Python one that was being used before. We only used Python until
now because we based this repo on its Python sibling.

This PR also shows that the code change to use a different language
in this workflow is really not very big.

This repo now uses a Java client SDK, rather than
the Python one that was being used before.  We only used Python before
this commit because we based this repo on [it's Python sibling][1].

This commit also shows that the code change to use a different language
in this workflow is really not very big.

[1] https://github.com/agilepathway/gauge-openapi-example
Removing because there is a bug whereby the Java OpenAPI Generator sends
GET requests with a content-type, which causes Prism to reject these
requests.

The bug is the same (in Java) as the [Python bug][1] which was fixed
earlier in 2021.  It may well be more difficult to fix in Java, however,
as Java is the core language which OpenAPI Generator is written in.

Using the Prism validation proxy mode is more important than using the
OpenAPI Generator, so we may well want to refactor this repo to
reinstate the validation proxy and to remove the Generator.  This would
mean that we would hand-roll our own client code, but that's ok - as the
[Thoughtworks Tech Radar says][2], this type of bug is one of the risks
of using generated code rather than rolling our own.

[1]: OpenAPITools/openapi-generator#9852
[2]: https://www.thoughtworks.com/radar/techniques/spec-based-codegen
@johnboyes johnboyes merged commit 453d99e into master Nov 2, 2021
@johnboyes johnboyes deleted the use-java branch November 2, 2021 22:56
johnboyes added a commit that referenced this pull request Nov 11, 2021
Now that we have removed the OpenAPI Generator we can go ahead and
reinstate the [Prism validation proxy][1] tests, which were removed
in #1

[1]: https://meta.stoplight.io/docs/prism/docs/guides/03-validation-proxy.md
johnboyes added a commit that referenced this pull request Nov 11, 2021
Now that we have removed the OpenAPI Generator we can go ahead and
reinstate the [Prism validation proxy][1] tests, which were removed
in #1

[1]: https://meta.stoplight.io/docs/prism/docs/guides/03-validation-proxy.md
johnboyes added a commit that referenced this pull request Nov 11, 2021
* Remove OpenAPI Generator

* Reinstate validation proxy CI tests

Now that we have removed the OpenAPI Generator we can go ahead and
reinstate the [Prism validation proxy][1] tests, which were removed
in #1

[1]: https://meta.stoplight.io/docs/prism/docs/guides/03-validation-proxy.md

* Fix build by making pet name not required

Some of the pets currently in the production pet store currently don't
have names, which was correctly causing Prism to return an error saying
so when running in validation proxy mode.

This commit fixes that issue by making the name (and photo URL) not
required any more in our OpenAPI specification.
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.

1 participant