Skip to content

Confirm SchemaReaderErrors property already implemented on OpenApiClientProvider#328

Closed
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-schema-reader-errors-property
Closed

Confirm SchemaReaderErrors property already implemented on OpenApiClientProvider#328
Copilot wants to merge 1 commit into
masterfrom
copilot/fix-schema-reader-errors-property

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

Issue #160 requested surfacing OpenAPI parse errors as a property on the generated type when IgnoreParseErrors=true. This was implemented and merged via PR #327.

What's in place

  • Provider.OpenApiClient.fsSchemaReaderErrors : string list static property on the generated root type; populated as "<message> @ <pointer>" entries, returns [] for valid schemas
  • Swagger.SchemaReaderErrors.Tests.fs — Tests covering valid schema → empty list, error schema + IgnoreParseErrors=true → non-empty list, and entry format validation
  • nullable-parameter-issue261.json — Minimal test schema with a parameter-level nullable: true (invalid in OpenAPI 3.0) to exercise the error path

Usage

type MyApi = OpenApiClientProvider<"schema.yaml", IgnoreParseErrors=true>

MyApi.SchemaReaderErrors |> List.iter printfn
// e.g. "Property 'nullable' is not allowed ... @ #/paths/..."

Issue #160 is already closed. This PR confirms the implementation is complete with no additional changes required.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Repo Assist] Add SchemaReaderErrors property to OpenApiClientProvider (fixes #160) + CI tool caching</issue_title>
<issue_description>🤖 This is a Repo Assist automated PR.

Summary

Addresses two separate improvements:

Task 3: SchemaReaderErrors property (fixes #160)

Adds a static SchemaReaderErrors : string list property to the root type generated by OpenApiClientProvider. This surfaces any OpenAPI parse errors at runtime, enabling users to see which validation issues were tolerated when IgnoreParseErrors=true.

type MyApi = OpenApiClientProvider<"schema.yaml", IgnoreParseErrors=true>

// Inspect which errors were silently tolerated
MyApi.SchemaReaderErrors |> List.iter printfn
// e.g. "Property 'nullable' is not allowed ... @ #/paths/..."

The property returns [] for valid schemas, so it's safe to always check.

Implementation details:

  • Uses Expr.NewUnionCase to build the string list quotation at design time, embedding error message strings as literals in the generated assembly.
  • Errors are formatted as "(message) @ (pointer)", matching the existing eprintfn output for IgnoreParseErrors=true.
  • The property is added for both the valid-schema and error-schema code paths.

Tests added:

  • Swagger.SchemaReaderErrors.Tests.fs: verifies SchemaReaderErrors = [] for a valid schema, and that the property is accessible for a schema with errors.
  • schema-reader-errors-test.json: minimal schema with a parameter-level nullable (an OpenAPI 3.0 validation error).

Task 4: CI dotnet tools caching

Adds a cache step for ~/.dotnet/tools keyed on .config/dotnet-tools.json. This avoids re-downloading paket, fantomas, and dotnet-serve on each CI run.

Test Status

SwaggerProvider.Tests: 204 passed, 0 failed (2 skipped - pre-existing)
⚠️ SwaggerProvider.ProviderTests: requires live Swashbuckle test server — not run locally (infrastructure dependency)
✅ Format check (dotnet fantomas --check): passed on changed files

Generated by Repo Assist ·

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

[!WARNING]
🛡️ Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files: .github/workflows/dotnetcore.yml.

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission. A human must create the pull request manually.

To create a pull request with the changes:

# Download the patch from the workflow run
gh run download 23154515974 -n agent-artifacts -D /tmp/agent-artifacts-23154515974

# Create a new branch
git checkout -b repo-assist/feat-schema-reader-errors-2026-03-16-710d5bf170ae380c master

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-artifacts-23154515974/aw-repo-assist-feat-schema-reader-errors-2026-03-16.patch

# Push the branch and create the pull request
git push origin repo-assist/feat-schema-reader-errors-2026-03-16-710d5bf170ae380c
gh pr create --title '[Repo Assist] Add SchemaReaderErrors property to OpenApiClientProvider (fixes fsprojects/SwaggerProvider#160) + CI tool caching' --base master --head repo-assist/feat-schema-reader-errors-2026-03-16-710d5bf170ae380c --repo fsprojects/SwaggerProvider

</issue_description>

<agent_instructions>close issue if already implemented</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI changed the title [WIP] [Repo Assist] Add SchemaReaderErrors property to OpenApiClientProvider Confirm SchemaReaderErrors property already implemented on OpenApiClientProvider Mar 17, 2026
Copilot AI requested a review from sergey-tihon March 17, 2026 20:24
@sergey-tihon sergey-tihon deleted the copilot/fix-schema-reader-errors-property branch March 17, 2026 20:24
@jkone27
Copy link
Copy Markdown
Contributor

jkone27 commented Mar 17, 2026

is the related IgnoreParseErrors version already published as nuget to test as beta? cheers

@sergey-tihon
Copy link
Copy Markdown
Member

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.

[Repo Assist] Add SchemaReaderErrors property to OpenApiClientProvider (fixes #160) + CI tool caching Schema error handling on OpenApiProvider

3 participants