Skip to content

Stringify objects when posting a form-encoded body#1401

Open
mdellweg wants to merge 1 commit into
pulp:mainfrom
mdellweg:html_form_encode
Open

Stringify objects when posting a form-encoded body#1401
mdellweg wants to merge 1 commit into
pulp:mainfrom
mdellweg:html_form_encode

Conversation

@mdellweg
Copy link
Copy Markdown
Member

No description provided.

@mdellweg mdellweg force-pushed the html_form_encode branch 4 times, most recently from 636f1d1 to 99ad0ff Compare May 20, 2026 11:33
@mdellweg mdellweg force-pushed the html_form_encode branch from 99ad0ff to 6fde5c6 Compare May 20, 2026 12:30
@mdellweg mdellweg marked this pull request as ready for review May 20, 2026 13:25
if isinstance(body, dict):
data = {k: encode_stringify(v) for k, v in body.items()}
else:
data = encode_param(body)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if body is a list of dicts? Is this possible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet in our api. And I'd need to reread the specification in that case.

from pulp_glue.common import oas
from pulp_glue.common.exceptions import SchemaError, ValidationError
from pulp_glue.common.schema import (
encode_html,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to add a test for encode_stringify?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can, I guess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants