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

Generating dictionaries for free-form objects with Gradle plugin? #4709

Open
joe-akeem opened this issue Jul 4, 2024 · 0 comments
Open

Generating dictionaries for free-form objects with Gradle plugin? #4709

joe-akeem opened this issue Jul 4, 2024 · 0 comments

Comments

@joe-akeem
Copy link

According to the documentation for dictionaries, they can contain free-form objects which are specified in one of the following forms:

type: object
"additionalProperties": {} 
type: object
"additionalProperties": true

How would I annotate the following Java code so the Gradle resolve task generates an OpenApi dictionary in the form above?

public class CreateRequest {
    private Map<String, Object> contextData;
}

Without any annotation I end up with the following specification:

"additionalProperties": {
    "type": "object",
    "nullable": true
  }

This isn't quite the same as this dictionary couldn't hold strings, for example (a "string" is not an "object" in OpenApi).

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

No branches or pull requests

1 participant