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

sashabaranov/go-openai/jsonschema not omitting emptyproperties #524

Closed
boyswan opened this issue Nov 6, 2023 · 3 comments
Closed

sashabaranov/go-openai/jsonschema not omitting emptyproperties #524

boyswan opened this issue Nov 6, 2023 · 3 comments
Labels
question Further information is requested stale

Comments

@boyswan
Copy link

boyswan commented Nov 6, 2023

Given:

jsonschema.Definition{
	Type: jsonschema.Object,
	Properties: map[string]jsonschema.Definition{
		"foo": {
			Type:        jsonschema.Array,
			Description: "Array of foo",
			Items: &jsonschema.Definition{
				Type:        jsonschema.String,
				Description: "bar",
			},
		},
	},
}

When converted to json, 'properties {}` is unnecessarily included.

{
  "type": "object",
  "properties": {
    "foo": {
      "type": "array",
      "description": "Array of foo",
      "properties": {}, <-
      "items": {
        "type": "string",
        "description": "bar",
        "properties": {} <-
      }
    }
  }
}
@boyswan boyswan added the bug Something isn't working label Nov 6, 2023
@vvatanabe
Copy link
Collaborator

@boyswan Intentionally initializing with an empty map. For the reason, please refer to the following PR.
#431

@vvatanabe vvatanabe added question Further information is requested and removed bug Something isn't working labels Nov 7, 2023
Copy link

github-actions bot commented Dec 8, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 8, 2023
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants