-
Notifications
You must be signed in to change notification settings - Fork 5
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
Auto generated code generated with a syntax error #34
Comments
Could you please include a bit more details? It would be nice if I could reproduce it. A sample file with reproducible steps would be the best. |
For example, given below is WpTemplateTitle generated class and in another generated class this is how it is being declared
whereas it should be ` import java.util.Objects; @JsonPropertyOrder({ public static final String JSON_PROPERTY_RENDERED = "rendered"; public WpTemplateTitle() { public WpTemplateTitle raw(String raw) { @javax.annotation.Nullable public String getRaw() { @JsonProperty(JSON_PROPERTY_RAW) public WpTemplateTitle rendered(String rendered) { @javax.annotation.Nullable public String getRendered() { @JsonProperty(JSON_PROPERTY_RENDERED) @OverRide @OverRide @OverRide private String toIndentedString(Object o) { } ` |
Sorry for the delay. I see what you mean. You've converted your site to Swagger JSON and used JSON to JAVA converter. Unfortunately, I can't help as I'm not familiar with how java converter works. What are you using exactly? |
I am using Swagger-codegen utility to generate java code |
any update on this issue? facing the same problem with swagger codegen |
Sorry for the update It seems like Swagger-codegen doesn't support OpenAPI 3.1 yet. |
So what you suggest I should downgrade the openapi plugin?
…On Sun, Dec 24, 2023, 13:01 Moon ***@***.***> wrote:
Sorry for the update
It seems like Swagger-codegen doesn't support OpenAPI 3.1 yet.
See: swagger-api/swagger-codegen#12210
<swagger-api/swagger-codegen#12210>
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE57G3D73RCXIWTS4YC4RZTYK7ONZAVCNFSM6AAAAAA763H43GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGQ2TOMBZGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@xam33r Unfortunately, I don't think there is a workaround at the moment. This plugin can't support OpenAPI 3.0 since WordPress schema uses the latest JSON Schema, which is what OpenAPI 3.1 uses. I would closely watch |
Ok, thanks for the update.
…On Mon, Dec 25, 2023, 05:46 Moon ***@***.***> wrote:
@xam33r <https://github.com/xam33r> Unfortunately, I don't think there is
a workaround at the moment. This plugin can't support OpenAPI 3.0 since
WordPress schema uses the latest JSON Schema, which is what OpenAPI 3.1
uses. I would closely watch
swagger-api/swagger-codegen#12210
<swagger-api/swagger-codegen#12210> and wait
for them to upgrade.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE57G3EWMG5WLL7ERJ5VTXLYLDEG3AVCNFSM6AAAAAA763H43GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGYZDSNBWG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
the thing is that swagger is supporting 3.1 already. Take a look into my post there with the details. swagger integrated it already a year ago |
Then why it's causing problems with my code? can you please have a look and
help?
…On Tue, 26 Dec 2023 at 15:12, Darko ***@***.***> wrote:
@xam33r <https://github.com/xam33r> Unfortunately, I don't think there is
a workaround at the moment. This plugin can't support OpenAPI 3.0 since
WordPress schema uses the latest JSON Schema, which is what OpenAPI 3.1
uses. I would closely watch swagger-api/swagger-codegen#12210
<swagger-api/swagger-codegen#12210> and wait
for them to upgrade.
the thing is that swagger is supporting 3.1 already. Take a look into my
post there with the details. swagger integrated it already a year ago
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE57G3FQLMZ4WWNZZHCQLADYLKPIPAVCNFSM6AAAAAA763H43GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGQZTCNJVGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
--
Regards,
Zameer Faiz
Sr. Java Developer
Contact
+92302-5477923 ***@***.***>
LinkedIn Profile <https://pk.linkedin.com/in/zameerfaiz>
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you are not the named addressee you should not disclose, disseminate,
distribute or copy this e-mail. Please notify the sender immediately by
e-mail if you have received this by mistake, and delete this e-mail from
your system.
|
Swagger and Swagger-codegen are two different projects AFAIK. Just because Swagger announced and has a tool for support 3.1, it does not mean other tools are ready for 3.1. This was one of the reasons why I used Elements viewer instead of the official Swagger viewer. At the time of writing this plugin, even the official Swagger viewer did not support OpenAPI 3.1 :) There isn't even a stable version of Swagger-editor that supports OpenAPI 3.1 yet. Only 5.x.x alpha versions support 3.1 as far as I remember. Update 1: I've looked at the link you provided in the issue (https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---OpenAPI-3.1). It seems like 3.1 should be supported by now according to the check marks on the page 🤔 I'll wait someone to reply to your comment and see where it goes. |
Using wp-openapi I turned my basic version of wordpress website to a webapi and used it's description to generate swagger code for java, and that code is generated with a syntax error like this below.
public static final String JSON_PROPERTY_CONTENT = "content";
private WpTemplateContent content = ;
public static final String JSON_PROPERTY_TITLE = "title";
private WpTemplateTitle title = ;
can you please help?
The text was updated successfully, but these errors were encountered: