Skip to content

Add additional response representations - #96

Merged
eviltester merged 1 commit into
masterfrom
codex/91-more-content-output-representations
Jul 30, 2026
Merged

Add additional response representations#96
eviltester merged 1 commit into
masterfrom
codex/91-more-content-output-representations

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • Add Accept-header based response media selection for CSV, plain text, HTML, NDJSON, JSONL, JSON sequence, and TSV.
  • Centralise all supported response media types in the Accept-header enum so serializers and docs share one source of truth.
  • Add serializers, parser/validator coverage, HTTP coverage, and OpenAPI/HTML documentation updates.

Verification

  • mvn -pl thingifier -am -DfailIfNoTests=false test
  • mvn -q -DfailIfNoTests=false clean test -> 971 tests, 0 failures, 0 errors, 0 skipped

Closes #91

Copilot AI review requested due to automatic review settings July 30, 2026 22:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit c7fcdd6 into master Jul 30, 2026
3 checks passed
@eviltester
eviltester deleted the codex/91-more-content-output-representations branch July 30, 2026 22:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb25a555c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +194 to +200
public List<ACCEPT_TYPE> getSupportedTypesInPreferenceOrder() {
List<ACCEPT_TYPE> supportedTypes = new ArrayList<>();
for (String acceptedType : acceptMediaTypeDefinitionsList) {
ACCEPT_TYPE matchingType = getMatchingType(acceptedType);
if (matchingType != ACCEPT_TYPE.NO_MATCHING_TYPE) {
supportedTypes.add(matchingType);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exclude zero-quality media types from response selection

When a client sends Accept: text/csv;q=0, application/json;q=1, the parser strips the parameters and still returns CSV first in this list, so HttpApiResponse responds with text/csv even though the client explicitly rejected it. Parse quality values, discard entries with q=0, and order the remaining representations by quality before selection.

Useful? React with 👍 / 👎.

Comment on lines +21 to +22
public String getJsonLines() {
return String.join("\n", jsonObjects());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Terminate every NDJSON record with a newline

For any nonempty application/x-ndjson response, joining records places newlines only between them, leaving the final JSON text unterminated. NDJSON framing requires every JSON text to be followed by a newline, and the missing terminator can prevent incremental consumers from recognizing the last record or cause it to merge with subsequently concatenated output.

Useful? React with 👍 / 👎.

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.

More content output representations

2 participants