fix(tests): remove xfail from test_build_metadata simple-url case

Closed
KH
1mo ago
+9-8

The xfail blamed a Pydantic bug about trailing slashes, but the real issue was that AnyHttpUrl('https://auth.example.com') normalizes the URL to 'https://auth.example.com/' at construction time. Once built, passing that object to a model with url_preserve_empty_path=True has no effect — the config only applies when parsing from a string.

Fix: construct test inputs via TypeAdapter(AnyHttpUrl, config=ConfigDict(url_preserve_empty_path=True)).validate_python(), which mirrors how AuthSettings parses issuer_url in production and preserves the empty path correctly end to end.

Fixes #

Motivation and Context

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I am assigned to the linked issue (or it is labeled help wanted, or I'm a maintainer)
  • I have disclosed any AI assistance and can explain the change in my own words
  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context