Full Code of go-openapi/swag for AI

master e0895114b04a cached
223 files
2.4 MB
650.9k tokens
940 symbols
1 requests
Download .txt
Showing preview only (2,602K chars total). Download the full file or copy to clipboard to get everything.
Repository: go-openapi/swag
Branch: master
Commit: e0895114b04a
Files: 223
Total size: 2.4 MB

Directory structure:
gitextract_9aq_6a1_/

├── .claude/
│   ├── .gitignore
│   ├── CLAUDE.md
│   └── rules/
│       ├── contributions.md
│       ├── github-workflows-conventions.md
│       ├── go-conventions.md
│       ├── linting.md
│       └── testing.md
├── .codecov.yml
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CONTRIBUTING.md
│   ├── DCO.md
│   ├── copilot-instructions.md
│   ├── dependabot.yaml
│   ├── wordlist.txt
│   └── workflows/
│       ├── auto-merge.yml
│       ├── bump-release.yml
│       ├── codeql.yml
│       ├── contributors.yml
│       ├── go-test.yml
│       ├── scanner.yml
│       └── tag-release.yml
├── .gitignore
├── .golangci.yml
├── .mockery.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTORS.md
├── LICENSE
├── README.md
├── SECURITY.md
├── cmdutils/
│   ├── cmd_utils.go
│   ├── doc.go
│   ├── go.mod
│   └── go.sum
├── cmdutils_iface.go
├── cmdutils_iface_test.go
├── conv/
│   ├── convert.go
│   ├── convert_format_test.go
│   ├── convert_types.go
│   ├── convert_types_test.go
│   ├── doc.go
│   ├── format.go
│   ├── go.mod
│   ├── go.sum
│   ├── sizeof.go
│   └── type_constraints.go
├── conv_iface.go
├── conv_iface_test.go
├── doc.go
├── docs/
│   ├── MAINTAINERS.md
│   ├── NOTES.md
│   ├── STYLE.md
│   └── TODOS.md
├── fileutils/
│   ├── doc.go
│   ├── file.go
│   ├── file_test.go
│   ├── go.mod
│   ├── go.sum
│   ├── path.go
│   └── path_test.go
├── fileutils_iface.go
├── fileutils_iface_test.go
├── go.mod
├── go.sum
├── go.work
├── go.work.sum
├── hack/
│   └── .gitkeep
├── jsonname/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── go_name_provider.go
│   ├── go_name_provider_test.go
│   ├── ifaces.go
│   ├── name_provider.go
│   └── name_provider_test.go
├── jsonname_iface.go
├── jsonname_iface_test.go
├── jsonutils/
│   ├── README.md
│   ├── adapters/
│   │   ├── doc.go
│   │   ├── easyjson/
│   │   │   ├── doc.go
│   │   │   ├── go.mod
│   │   │   ├── go.sum
│   │   │   └── json/
│   │   │       ├── adapter.go
│   │   │       ├── adapter_test.go
│   │   │       ├── doc.go
│   │   │       ├── options.go
│   │   │       ├── ordered_map.go
│   │   │       ├── ordered_map_test.go
│   │   │       ├── pool.go
│   │   │       └── register.go
│   │   ├── ifaces/
│   │   │   ├── doc.go
│   │   │   ├── ifaces.go
│   │   │   ├── mocks/
│   │   │   │   └── mocks.go
│   │   │   ├── registry_iface.go
│   │   │   └── registry_ifaces_test.go
│   │   ├── registry.go
│   │   ├── registry_test.go
│   │   ├── stdlib/
│   │   │   ├── doc.go
│   │   │   └── json/
│   │   │       ├── adapter.go
│   │   │       ├── adapter_test.go
│   │   │       ├── doc.go
│   │   │       ├── lexer.go
│   │   │       ├── lexer_test.go
│   │   │       ├── ordered_map.go
│   │   │       ├── ordered_map_test.go
│   │   │       ├── pool.go
│   │   │       ├── register.go
│   │   │       ├── writer.go
│   │   │       └── writer_test.go
│   │   └── testintegration/
│   │       ├── benchmarks/
│   │       │   ├── README.md
│   │       │   ├── benchmarks_test.go
│   │       │   ├── fixtures/
│   │       │   │   ├── large.json
│   │       │   │   ├── large_sample.json
│   │       │   │   ├── medium_sample.json
│   │       │   │   ├── small.json
│   │       │   │   ├── small_sample.json
│   │       │   │   └── tiny.json
│   │       │   ├── go.mod
│   │       │   ├── go.sum
│   │       │   ├── payloads.go
│   │       │   ├── payloads_easyjson.go
│   │       │   └── payloads_test.go
│   │       ├── doc.go
│   │       ├── go.mod
│   │       ├── go.sum
│   │       ├── ifaces.go
│   │       ├── integration_suite_test.go
│   │       ├── integration_test.go
│   │       └── mocks_test.go
│   ├── concat.go
│   ├── concat_test.go
│   ├── doc.go
│   ├── examples_test.go
│   ├── fixtures_test/
│   │   ├── doc.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── harness.go
│   │   ├── harness_test.go
│   │   └── ordered_fixtures.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── json.go
│   ├── json_test.go
│   ├── ordered_map.go
│   └── ordered_map_test.go
├── jsonutils_iface.go
├── jsonutils_iface_test.go
├── loading/
│   ├── doc.go
│   ├── errors.go
│   ├── fixtures/
│   │   ├── petstore_fixture.json
│   │   └── petstore_fixture.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── json.go
│   ├── json_test.go
│   ├── loading.go
│   ├── loading_test.go
│   ├── options.go
│   ├── serve_test.go
│   ├── yaml.go
│   └── yaml_test.go
├── loading_iface.go
├── loading_iface_test.go
├── mangling/
│   ├── BENCHMARK.md
│   ├── doc.go
│   ├── fuzz_test.go
│   ├── go.mod
│   ├── go.sum
│   ├── initialism_index.go
│   ├── initialism_index_test.go
│   ├── name_lexem.go
│   ├── name_lexem_test.go
│   ├── name_mangler.go
│   ├── name_mangler_benchmark_test.go
│   ├── name_mangler_test.go
│   ├── options.go
│   ├── pools.go
│   ├── split.go
│   ├── split_test.go
│   ├── string_bytes.go
│   ├── testdata/
│   │   └── fuzz/
│   │       └── FuzzToGoName/
│   │           └── 3e4b026d1078ac6b
│   ├── util.go
│   └── util_test.go
├── mangling_iface.go
├── mangling_iface_test.go
├── netutils/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── net.go
│   └── net_test.go
├── netutils_iface.go
├── netutils_iface_test.go
├── stringutils/
│   ├── collection_formats.go
│   ├── collection_formats_test.go
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── strings.go
│   └── strings_test.go
├── stringutils_iface.go
├── stringutils_iface_test.go
├── typeutils/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── types.go
│   └── types_test.go
├── typeutils_iface.go
├── typeutils_iface_test.go
├── yamlutils/
│   ├── doc.go
│   ├── errors.go
│   ├── examples_test.go
│   ├── fixtures/
│   │   ├── fixture_2224.yaml
│   │   ├── fixture_spec_tags.yaml
│   │   ├── fixture_with_quoted.yaml
│   │   └── fixture_with_ykey.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── ordered_map.go
│   ├── ordered_map_test.go
│   ├── yaml.go
│   └── yaml_test.go
├── yamlutils_iface.go
└── yamlutils_iface_test.go

================================================
FILE CONTENTS
================================================

================================================
FILE: .claude/.gitignore
================================================
plans/
skills/
commands/
agents/
hooks/


================================================
FILE: .claude/CLAUDE.md
================================================
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Go monorepo of utility libraries for the `go-openapi` / `go-swagger` ecosystem. The root package
is a **backward-compat facade** — all its exported functions are deprecated and delegate to sub-packages.

See [docs/MAINTAINERS.md](../docs/MAINTAINERS.md) for CI/CD, release process, and repo structure details.

## Workspace & Modules

Go workspace (`go.work`, Go 1.24). Contains 15+ modules:

| Module | Purpose |
|--------|---------|
| `.` (root) | Deprecated shims forwarding to sub-packages |
| `cmdutils` | CLI utility helpers |
| `conv` | Type conversions: string-to-value, value-to-pointer, pointer-to-value (generics) |
| `fileutils` | File and path utilities |
| `jsonname` | Infer JSON field names from Go struct tags |
| `jsonutils` | JSON read/write, `ConcatJSON`, `JSONMapSlice`; pluggable adapter system |
| `jsonutils/adapters/easyjson` | easyjson adapter (separate module to isolate dependency) |
| `loading` | Load specs from filesystem or HTTP |
| `mangling` | Name mangling: `ToGoName`, `ToFileName`, `ToVarName`, etc.; configurable initialisms |
| `netutils` | Host/port parsing |
| `stringutils` | Slice search, query parameter splitting |
| `typeutils` | Zero-value and nil-safe interface checks |
| `yamlutils` | YAML-to-JSON conversion, ordered YAML documents |

Inter-module dependencies use `replace` directives pointing to local paths.

## Testing

```sh
# Run all tests across every workspace module
go test work ./...

# Run tests for a single module
go test ./conv/...
```

Note: plain `go test ./...` only tests the root module. The `work` pattern expands to all
modules listed in `go.work`.

CI runs tests on `{ubuntu, macos, windows} x {stable, oldstable}` with `-race` via `gotestsum`.

### Fuzz tests

```sh
# List all fuzz targets across the workspace
go test work -list Fuzz ./...

# Run a specific fuzz target (go test -fuzz cannot span multiple packages)
go test -fuzz=Fuzz -run='FuzzToGoName$' -fuzztime=1m30s ./mangling
```

Fuzz corpus lives in `testdata/fuzz/` within each package. CI runs each fuzz target for 1m30s
with a 5m minimize timeout.

### Test framework

`github.com/go-openapi/testify/v2` — a zero-dep fork of `stretchr/testify`.
Because it's a fork, `testifylint` does not work.

Patterns: table-driven tests with `t.Run`, fuzz tests, benchmarks, and integration
tests in `jsonutils/adapters/testintegration/`.

## Linting

```sh
golangci-lint run
```

Config: `.golangci.yml` — posture is `default: all` with explicit disables.
See [docs/STYLE.md](../docs/STYLE.md) for the rationale behind each disabled linter.

Key rules:
- Every `//nolint` directive **must** have an inline comment explaining why.
- Prefer disabling a linter over scattering `//nolint` across the codebase.

## Code Conventions

- All files must have SPDX license headers (Apache-2.0).
- Go version policy: support the 2 latest stable Go minor versions.
- Commits require DCO sign-off (`git commit -s`).
- Root-level `*_iface.go` files are thin deprecated wrappers — do not add new public API there.
- `jsonutils` uses a pluggable adapter registry (`adapters.Registry`); new JSON backends
  should be separate modules implementing interfaces from `jsonutils/adapters/ifaces`.
- `mangling.NameMangler` is configured via functional options and is concurrency-safe.


================================================
FILE: .claude/rules/contributions.md
================================================
---
paths:
  - "**/*"
---

# Contribution rules (go-openapi)

Read `.github/CONTRIBUTING.md` before opening a pull request.

## Commit hygiene

- Every commit **must** be DCO signed-off (`git commit -s`) with a real email address.
  PGP-signed commits are appreciated but not required.
- Agents may be listed as co-authors (`Co-Authored-By:`) but the commit **author must be the human sponsor**.
  We do not accept commits solely authored by bots or agents.
- Squash commits into logical units of work before requesting review (`git rebase -i`).

## Linting

Before pushing, verify your changes pass linting against the base branch:

```sh
golangci-lint run --new-from-rev master
```

Install the latest version if you don't have it:

```sh
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
```

## Problem statement

- Clearly describe the problem the PR solves, or reference an existing issue.
- PR descriptions must not be vague ("fix bug", "improve code") — explain *what* was wrong and *why* the change is correct.

## Tests are mandatory

- Every bug fix or feature **must** include tests that demonstrate the problem and verify the fix.
- The only exceptions are documentation changes and typo fixes.
- Aim for at least 80% coverage of your patch.
- Run the full test suite before submitting:

For mono-repos:
```sh
go test work ./...
```

For single module repos:
```sh
go test ./...
```


================================================
FILE: .claude/rules/github-workflows-conventions.md
================================================
---
paths:
  - ".github/workflows/**.yml"
  - ".github/workflows/**.yaml"
---

# GitHub Actions Workflows Formatting and Style Conventions

This rule captures YAML and bash formatting rules to provide a consistent maintainer's experience across CI workflows.

## File Structure

**REQUIRED**:  All github action workflows are organized as a flat structure beneath `.github/workflows/`.

> GitHub does not support a hierarchical organization for workflows yet.

**REQUIRED**:  YAML files are conventionally named `{workflow}.yml`, with the `.yml` extension.

## Code Style & Formatting

### Expression Spacing

**REQUIRED**: All GitHub Actions expressions must have spaces inside the braces:

```yaml
# ✅ CORRECT
env:
  PR_URL: ${{ github.event.pull_request.html_url }}
  TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ❌ WRONG
env:
  PR_URL: ${{github.event.pull_request.html_url}}
  TOKEN: ${{secrets.GITHUB_TOKEN}}
```

> Provides a consistent formatting rule.

### Conditional Syntax

**REQUIRED**: Always use `${{ }}` in `if:` conditions:

```yaml
# ✅ CORRECT
if: ${{ inputs.enable-signing == 'true' }}
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}

# ❌ WRONG (works but inconsistent)
if: inputs.enable-signing == 'true'
```

> Provides a consistent formatting rule.

### GitHub Workflow Commands

**REQUIRED**: Use workflow commands for status messages that should appear as annotations, with **double colon separator**:

```bash
# ✅ CORRECT - Double colon (::) separator after title
echo "::notice title=build::Build completed successfully"
echo "::warning title=race-condition::Merge already in progress"
echo "::error title=deployment::Failed to deploy"

# ❌ WRONG - Single colon separator (won't render as annotation)
echo "::notice title=build:Build completed"  # Missing second ':'
echo "::warning title=x:message"             # Won't display correctly
```

**Syntax pattern:** `::LEVEL title=TITLE::MESSAGE`
- `LEVEL`: notice, warning, or error
- Double `::` separator is required between title and message

> Wrong syntax may raise untidy warnings and produce botched output.

### YAML arrays formatting

For steps, YAML arrays are formatted with the following indentation:

```yaml
# ✅ CORRECT - Clear spacing between steps
    steps:
      -
        name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
      -
        name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0

# ❌ WRONG - Dense format, more difficult to read
    steps:
      - name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0

# ❌ WRONG - YAML comment or blank line could be avoided
    steps:
      #
      - name: Dependabot metadata
        id: metadata
        uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0

      - name: Checkout repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0
```

## Security Best Practices

### Version Pinning using SHAs

**REQUIRED**: Always pin action versions to commit SHAs:

> Runs must be repeatable with known pinned version. Automated updates are pushed frequently (e.g. daily or weekly)
> to keep pinned versions up-to-date.

```yaml
# ✅ CORRECT - Pinned to commit SHA with version comment
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0

# ❌ WRONG - Mutable tag reference
uses: actions/checkout@v6
```

### Permission settings

**REQUIRED**: Always set minimal permissions at the workflow level.

```yaml
# ✅ CORRECT - Workflow level permissions set to minimum
permissions:
  contents: read

# ❌ WRONG - Workflow level permissions with undue privilege escalation
permissions:
  contents: write
  pull-requests: write
```

**REQUIRED**: Whenever a job needs elevated privileges, always raise required permissions at the job level.

```yaml
# ✅ CORRECT - Job level permissions set to the specific requirements for that job
jobs:
  dependabot:
    permissions:
      contents: write
      pull-requests: write
    uses: ./.github/workflows/auto-merge.yml
    secrets: inherit

# ❌ WRONG - Same permissions but set at workflow level instead of job level
permissions:
  contents: write
  pull-requests: write
```

> (Security best practice detected by CodeQL analysis)

### Undue secret exposure

**NEVER** use `secrets[inputs.name]` — always use explicit secret parameters.

> Using keyed access to secrets forces the runner to expose ALL secrets to the job, which causes a security risk
> (caught and reported by CodeQL security analysis).

```yaml
# ❌ SECURITY VULNERABILITY
# This exposes ALL organization and repository secrets to the runner
on:
  workflow_call:
    inputs:
      secret-name:
        type: string
jobs:
  my-job:
    steps:
      - uses: some-action@v1
        with:
          token: ${{ secrets[inputs.secret-name] }}  # ❌ DANGEROUS!
```

**SOLUTION**: Use explicit secret parameters with fallback for defaults:

```yaml
# ✅ SECURE
on:
  workflow_call:
    secrets:
      gpg-private-key:
        required: false
jobs:
  my-job:
    steps:
      - uses: go-openapi/gh-actions/ci-jobs/bot-credentials@master
        with:
          # Falls back to go-openapi default if not explicitly passed
          gpg-private-key: ${{ secrets.gpg-private-key || secrets.CI_BOT_GPG_PRIVATE_KEY }}
```

## Common Gotchas

### Description fields containing parsable expressions

**REQUIRED**: **DO NOT** use `${{ }}` expressions in description fields:

> They may be parsed by the runner, wrongly interpreted or causing failure (e.g. "not defined in this context").

```yaml
# ❌ WRONG - Can cause YAML parsing errors
description: |
  Pass it as: gpg-private-key: ${{ secrets.MY_KEY }}

# ✅ CORRECT
description: |
  Pass it as: secrets.MY_KEY
```

### Boolean inputs

**Boolean inputs are forbidden**: NEVER use `type: boolean` for workflow inputs due to unpredictable type coercion

> gh-action expressions using boolean job inputs are hard to predict and come with many quirks.

   ```yaml
   # ❌ FORBIDDEN - Boolean inputs have type coercion issues
   on:
     workflow_call:
       inputs:
         enable-feature:
           type: boolean        # ❌ NEVER USE THIS
           default: true

   # The pattern `x == 'true' || x == true` seems safe but fails when:
   # - x is not a boolean: `x == true` evaluates to true if x != null
   # - Type coercion is unpredictable and error-prone

   # ✅ CORRECT - Always use string type for boolean-like inputs
   on:
     workflow_call:
       inputs:
         enable-feature:
           type: string         # ✅ Use string instead
           default: 'true'      # String value

   jobs:
     my-job:
       # Simple, reliable comparison
       if: ${{ inputs.enable-feature == 'true' }}

   # ✅ In bash, this works perfectly (inputs are always strings in bash):
   if [[ '${{ inputs.enable-feature }}' == 'true' ]]; then
     echo "Feature enabled"
   fi
   ```

   **Rule**: Use `type: string` with values `'true'` or `'false'` for all boolean-like workflow inputs.

   **Note**: Step outputs and bash variables are always strings, so `x == 'true'` works fine for those.

### YAML fold scalars in action inputs

**NEVER** use `>` or `>-` (fold scalars) for `with:` input values:

> The YAML spec says fold scalars replace newlines with spaces, but the GitHub Actions runner
> does not reliably honor this for action inputs. The action receives the literal multi-line string
> instead of a single folded line, which breaks flag parsing.

```yaml
# ❌ BROKEN - Fold scalar, args received with embedded newlines
- uses: goreleaser/goreleaser-action@...
  with:
    args: >-
      release
        --clean
        --release-notes /tmp/notes.md

# ✅ CORRECT - Single line
- uses: goreleaser/goreleaser-action@...
  with:
    args: release --clean --release-notes /tmp/notes.md

# ✅ CORRECT - Literal block scalar (|) is fine for run: scripts
- run: |
    echo "line 1"
    echo "line 2"
```

**Rule**: Use single-line strings for `with:` inputs. Only use `|` (literal block scalar) for `run:` scripts where multi-line is intentional.


================================================
FILE: .claude/rules/go-conventions.md
================================================
---
paths:
  - "**/*.go"
---

# Code conventions (go-openapi)

- All files must have SPDX license headers (Apache-2.0).
- Go version policy: support the 2 latest stable Go minor versions.
- Commits require DCO sign-off (`git commit -s`).
- use `golangci-lint fmt` to format code (not `gofmt` or `gofumpt`)


================================================
FILE: .claude/rules/linting.md
================================================
---
paths:
  - "**/*.go"
---

# Linting conventions (go-openapi)

```sh
golangci-lint run
```

Config: `.golangci.yml` — posture is `default: all` with explicit disables.
See `docs/STYLE.md` for the rationale behind each disabled linter.

Key rules:
- Every `//nolint` directive **must** have an inline comment explaining why.
- Prefer disabling a linter over scattering `//nolint` across the codebase.


================================================
FILE: .claude/rules/testing.md
================================================
---
paths:
  - "**/*_test.go"
---

# Testing conventions (go-openapi)

## Running tests

**Single module repos:**

```sh
go test ./...
```

**Mono-repos (with `go.work`):**

```sh
# All modules
go test work ./...

# Single module
go test ./conv/...
```

Note: in mono-repos, plain `go test ./...` only tests the root module.
The `work` pattern expands to all modules listed in `go.work`.

CI runs tests on `{ubuntu, macos, windows} x {stable, oldstable}` with `-race` via `gotestsum`.

## Fuzz tests

```sh
# List all fuzz targets
go test -list Fuzz ./...

# Run a specific target (go test -fuzz cannot span multiple packages)
go test -fuzz=Fuzz -run='FuzzTargetName$' -fuzztime=1m30s ./package
```

Fuzz corpus lives in `testdata/fuzz/` within each package. CI runs each fuzz target for 1m30s
with a 5m minimize timeout.

## Test framework

`github.com/go-openapi/testify/v2` — a zero-dep fork of `stretchr/testify`.
Because it's a fork, `testifylint` does not work.


================================================
FILE: .codecov.yml
================================================
ignore:
  - jsonutils/fixtures_test
  - jsonutils/adapters/ifaces/mocks
  - jsonutils/adapters/testintegration/benchmarks


================================================
FILE: .editorconfig
================================================
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

# Set default charset
[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
charset = utf-8

# Tab indentation (no size specified)
[*.go]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2


================================================
FILE: .gitattributes
================================================
# gofmt always uses LF, whereas Git uses CRLF on Windows.
*.go text eol=lf


================================================
FILE: .github/CONTRIBUTING.md
================================================
You'll find here general guidelines to contribute to this project.
They mostly correspond to standard practices for open source repositories.

We have tried to keep things as simple as possible.

> [!NOTE]
> If you're an experienced go developer on github, then you should just feel at home with us
> and you may well skip the rest of this document.
>
> You'll essentially apply the usual guidelines for a go library project on github.

These guidelines are common to all libraries published on github by the `go-openapi` organization,
so you'll feel at home with any of our projects.

You'll find more detailed (or repo-specific) instructions in the [maintainer's docs][maintainers-doc].

[maintainers-doc]: ../docs/MAINTAINERS.md

## How can I contribute

There are many ways in which you can contribute, not just code. Here are a few ideas:

- Reporting issues or bugs
- Suggesting improvements
- Documentation
- Art work that makes the project look great
- Code
    - proposing bug fixes and new features that are within the main project scope
    - improving test coverage
    - addressing code quality issues

## Questions & issues

### Asking a question

You may inquire anything about this library by reporting a "Question" issue on github.

You may also join our discord server where you may discuss issues or requests.

[![Discord Server][discord-badge]][discord-url]

[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue
[discord-url]: https://discord.gg/FfnFYaC3k5

### Reporting issues

Reporting a problem with our libraries _is_ a valuable contribution.
You can do this on the github issues page of this repository.

Please be as specific as possible when describing your issue.

Whenever relevant, please provide information about your environment (go version, OS).

Adding a code snippet to reproduce the issue is great, and a big time saver for maintainers.

### Triaging issues

You can help triage issues which may include:

* reproducing bug reports
* asking for important information, such as version numbers or reproduction instructions
* answering questions and sharing your insight in issue comments

## Code contributions

### Pull requests are always welcome

We are always thrilled to receive pull requests, and we do our best to
process them as fast as possible.

Not sure if that typo is worth a pull request? Do it! We will appreciate it.

If your pull request is not accepted on the first try, don't be discouraged!
If there's a problem with the implementation, hopefully you've received feedback on what to improve.

If you have a lot of ideas or a lot of issues to solve, try to refrain a bit and post focused
pull requests.
Think that they must be reviewed by a maintainer and it is easy to lose track of things on big PRs.

We're trying very hard to keep the go-openapi packages lean and focused.

Together, these packages constitute a toolkit for go developers:
it won't do everything for everybody out of the box,
but everybody can use it to do just about everything related to OpenAPI.

This means that we might decide against incorporating a new feature.

However, there might be a way to implement that feature *on top of* our libraries.

### Environment

You just need a `go` compiler to be installed. No special tools are needed to work with our libraries.

The minimal go compiler version required is always the old stable (latest minor go version - 1).

Our libraries are designed and tested to work on `Linux`, `MacOS` and `Windows`.

If you're used to work with `go` you should already have everything in place.

Although not required, you'll be certainly more productive with a local installation of `golangci-lint`,
the meta-linter our CI uses.

If you don't have it, you may install it like so:

```sh
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
```

### Conventions

#### Git flow

Fork the repo and make changes to your fork in a feature branch.

To submit a pull request, push your branch to your fork (e.g. `upstream` remote):
github will propose to open a pull request on the original repository.

Typically you'd follow some common naming conventions:

- if it's a bug fixing branch, name it `fix/XXX-something` where XXX is the number of the
  issue on github
- if it's a feature branch, create an enhancement issue to announce your
  intentions, and name it `feature/XXX-something` where XXX is the number of the issue.

NOTE: we don't enforce naming conventions on branches: it's your fork after all.

#### Tests

Submit unit tests for your changes.

Go has a great built-in test framework ; use it!

Take a look at existing tests for inspiration, and run the full test suite on your branch
before submitting a pull request.

Our CI measures test coverage and the test coverage of every patch.

Although not a blocking step - because there are so many special cases -
this is an indicator that maintainers consider when approving a PR.
Please try your best to cover at least 80% of your patch.

#### Code style

You may read our stance on code style [there](../docs/STYLE.md).

#### Documentation

Don't forget to update the documentation when creating or modifying a feature.

Most documentation for this library is directly found in code as comments for godoc.

The documentation for this go-openapi package is published on [the public go docs site][go-doc].

---

Check your documentation changes for clarity, concision, and correctness.

If you want to assess the rendering of your changes when published to `pkg.go.dev`, you may
want to install the `pkgsite` tool proposed by `golang.org`.

```sh
go install golang.org/x/pkgsite/cmd/pkgsite@latest
```

Then run on the repository folder:

```sh
pkgsite .
```

This will run a godoc server locally where you may see the documentation generated from your local repository.

[go-doc]: https://pkg.go.dev/github.com/go-openapi/swag

#### Commit messages

Pull requests descriptions should be as clear as possible and include a
reference to all the issues that they address.

Pull requests must not contain commits from other users or branches.

Commit messages are not required to follow the "conventional commit" rule, but it's certainly a good
thing to follow that convention (e.g. "fix: fixed panic in XYZ", "ci: did this", "feat: did that" ...).

The title in your commit message is used directly to produce our release notes: try to keep them neat.

The commit message body should detail your changes.

If an issue should be closed by a commit, please add this reference in the commit body:

```
* fixes #{issue number}
```

#### Code review

Code review comments may be added to your pull request.

Discuss, then make the suggested modifications and push additional commits to your feature branch.

Be sure to post a comment after pushing. The new commits will show up in the pull
request automatically, but the reviewers will not be notified unless you comment.

Before the pull request is merged,
**make sure that you've squashed your commits into logical units of work**
using `git rebase -i` and `git push -f`.

After every commit the test suite should be passing.

Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix.

#### Sign your work

Software is developed by real people.

The sign-off is a simple line at the end of your commit message,
which certifies that you wrote it or otherwise have the right to
pass it on as an open-source patch.

We require the simple DCO below with an email signing your commit.
PGP-signed commit are greatly appreciated but not required.

The rules are pretty simple:

- read our [DCO][dco-doc] (from [developercertificate.org][dco-source])
- if you agree with these terms, then you just add a line to every git commit message

```
Signed-off-by: Joe Smith <joe@gmail.com>
```

using your real name (sorry, no pseudonyms or anonymous contributions.)

You can add the sign-off when creating the git commit via `git commit -s`.

[dco-doc]: ./DCO.md
[dco-source]: https://developercertificate.org

## Code contributions by AI agents

Our agentic friends are welcome to contribute!

We only have a few demands to keep-up with human maintainers.

1. Issues and PRs written or posted by agents should always mention the original (human) poster for reference
2. We don't accept PRs attributed to agents. We don't want commits signed like "author: @claude.code".
   Agents or bots may coauthor commits, though.
3. Security vulnerability reports by agents should always be reported privately and mention the original (human) poster
   (see also [Security Policy][security-doc]).

[security-doc]: ../SECURITY.md


================================================
FILE: .github/DCO.md
================================================
# Developer's Certificate of Origin

```
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
```


================================================
FILE: .github/copilot-instructions.md
================================================
# Copilot Instructions

## Project Overview

Go mono-repo of utility libraries for the `go-openapi` / `go-swagger` ecosystem.
The root package is a backward-compatible facade — all its exported functions are
deprecated and delegate to sub-packages. New code belongs in the appropriate
sub-package, not the root.

The repo exists to give the go-swagger code generator and runtime a single,
well-tested set of helpers for name mangling, type conversions, JSON/YAML
handling, file loading, and other common tasks, without pulling in heavy
external dependencies.

## Workspace & Modules

Go workspace (`go.work`, Go 1.24) with 15+ modules including:
`conv`, `cmdutils`, `fileutils`, `jsonname`, `jsonutils`, `loading`,
`mangling`, `netutils`, `stringutils`, `typeutils`, `yamlutils`, and others.

## Conventions

Coding conventions are found beneath `.github/copilot`

### Summary

- All `.go` files must have SPDX license headers (Apache-2.0).
- Commits require DCO sign-off (`git commit -s`).
- Linting: `golangci-lint run` — config in `.golangci.yml` (posture: `default: all` with explicit disables).
- Every `//nolint` directive **must** have an inline comment explaining why.
- Tests: `go test work ./...` (mono-repo). CI runs on `{ubuntu, macos, windows} x {stable, oldstable}` with `-race`.
- Test framework: `github.com/go-openapi/testify/v2` (not `stretchr/testify`; `testifylint` does not work).

See `.github/copilot/` (symlinked to `.claude/rules/`) for detailed rules on Go conventions, linting, testing, and contributions.


================================================
FILE: .github/dependabot.yaml
================================================
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
      day: "friday"
    open-pull-requests-limit: 2          # <- default is 5
    allow:
      - dependency-type: all
    groups:                              # <- group all github actions updates in a single PR
      # 1. development-dependencies are auto-merged
      development-dependencies:
        patterns:
          - '*'
    assignees:
      - fredbi

  - package-ecosystem: "gomod"
    # We define 4 groups of dependencies to regroup update pull requests:
    # - development (e.g. test dependencies)
    # - go-openapi updates
    # - golang.org (e.g. golang.org/x/... packages)
    # - other dependencies (direct or indirect)
    #
    # * All groups are checked once a week and each produce at most 1 PR.
    # * All dependabot PRs are auto-approved
    #
    # Auto-merging policy, when requirements are met:
    # 1. development-dependencies are auto-merged
    # 2. golang.org-dependencies are auto-merged
    # 3. go-openapi patch updates are auto-merged. Minor/major version updates require a manual merge.
    # 4. other dependencies require a manual merge
    directories:
      - "**/*"
    schedule:
      interval: "weekly"
      day: "friday"
    open-pull-requests-limit: 4
    groups:
      development-dependencies:
        patterns:
          - "github.com/stretchr/testify"
          - "github.com/go-openapi/testify"

      golang-org-dependencies:
        patterns:
          - "golang.org/*"

      go-openapi-dependencies:
        patterns:
          - "github.com/go-openapi/*"
        exclude-patterns:
          - "github.com/go-openapi/testify"

      other-dependencies:
        exclude-patterns:
          - "github.com/go-openapi/*"
          - "github.com/stretchr/testify"
          - "github.com/go-openapi/testify"
          - "golang.org/*"
    allow:
      - dependency-type: all
    assignees:
      - fredbi


================================================
FILE: .github/wordlist.txt
================================================
API
APIs
Acknowledgements
Autocomplete
BDD
BSON
CI
CIDR
CLI
CLIs
CSV
CodeFactor
CodeQL
DCO
DSL
DockerHub
Enablement
FAQ
FDs
GC
GOPATH
GOROOT
HTTP
HTTPS
HUGO
ID
IDE's
IDs
IOW
IP
IPs
ISBN
ISC
JSON
JUnit
Kubernetes
LOC
Markdown
MaxDepth
Mezard
NUnit
NaN
OAI
OAuth
OpenAPI
OpenSSF
PHPUnit
PR
PR's
PRs
PkgGoDev
Pre
PyTest
README
RSpec
Ratcliff
ReadDir
Readlink
Reimplemented
Relinted
SCSS
SSN
SUnit
Subpackages
Substitutability
Subtests
Superlinear
TCP
TLS
TODO
TODOs
TTY
Teardown
Triaging
UI
ULID
URI
URL
URLs
USD
UUID
Unmarshalers
XYZ
YAML
ad'hoc
agentic
allocs
api
apis
arg
args
assignees
async
auth
authenticated
authenticator
authenticators
authorized
authorizer
authorizers
autogenerate
backquote
backquoted
bash
benchmarked
benchmarking
bitmask
bson
bytesize
cancelled
cgo
ci
cidr
cli
clis
cmp
codebase
codecov
codegen
colorizer
colorizers
config
configs
csv
ctx
customizable
de facto
dependabot
deps
dereference
dereferenced
dereferencing
deserialization
deserialize
deserialized
deserializer
dev
developercertificate
df
difflib
disambiguates
docker
dumpcgo
e.g.
easyjson
env
err's
faq
fd
fka
flattener
fmt
fromfile
fromfiledate
fuzzying
gc
github
globals
go-openapi
godoc
golang
golangci
golint
goroutine
goroutines
greenteagc
grpc
hexdump
hostname
hostnames
html
http
httpOK
https
hugo
i.e.
id
impactful
implementor
implementors
initialism
initialisms
inodes
io
ipsum
ipsums
ipv4
ipv6
isbn
iter
json
jsonschema
jsonutils
k8s
kubernetes
lifecycle
lineterm
linter
linter's
linters
listA
listB
logics
loren
lowercases
maintainer's
markdown
marshaled
marshaling
matchers
maths
md
metalinter
middleware
middlewares
mixin
mockFailNowT
mockT
monorepo
multipart
mutex
ns
oai
oauth
oauth2
openapi
param
params
pmezard
pollCondition
pprof
prepend
prepended
readlines
rebase
rebased
redeclare
relinting
repo
repos
roadmap
roundtrip
roundtripper
schema
schemas
semver
serialize
serialized
serializer
serializers
sexualized
spdx
ssn
stdlib
stretchr
struct
structs
submodule
subpackage
substring
subtests
superlinearly
swagger
syncing
testDataPath
testcgo
testify's
testifylint
tls
tm
tofile
tofiledate
toolchain
ui
ulid
uncategorized
unexported
unidiff
unmarshal
unmarshaled
unmarshaler
unmarshaling
unmarshals
untyped
uri
url
urls
utf-8
uuid
v1
v2
v3
validator
validators
vuln
windiff
workspace
workspaces
writelines
xunit
yaml
ℹ


================================================
FILE: .github/workflows/auto-merge.yml
================================================
name: Dependabot auto-merge

permissions:
  contents: read

on:
  pull_request:

jobs:
  dependabot:
    permissions:
      contents: write
      pull-requests: write
    uses: go-openapi/ci-workflows/.github/workflows/auto-merge.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    secrets: inherit


================================================
FILE: .github/workflows/bump-release.yml
================================================
name: Bump Release

permissions:
  contents: read


on:
  workflow_dispatch:
    inputs:
      bump-type:
        description: Type of bump (patch, minor, major)
        type: choice
        options:
        - patch
        - minor
        - major
        default: patch
        required: false
      tag-message-title:
        description: Tag message title to prepend to the release notes
        required: false
        type: string
      tag-message-body:
        description: |
          Tag message body to prepend to the release notes.
          (use "|" to replace end of line).
        required: false
        type: string

jobs:
  bump-release:
    permissions:
      contents: write
      pull-requests: write
    uses: go-openapi/ci-workflows/.github/workflows/bump-release-monorepo.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    with:
      bump-type: ${{ inputs.bump-type }}
      tag-message-title: ${{ inputs.tag-message-title }}
      tag-message-body: ${{ inputs.tag-message-body }}
    secrets: inherit


================================================
FILE: .github/workflows/codeql.yml
================================================
name: "CodeQL"

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]
    paths-ignore: # remove this clause if CodeQL is a required check
      - '**/*.md'
  schedule:
    - cron: '39 19 * * 5'

permissions:
  contents: read

jobs:
  codeql:
    permissions:
      contents: read
      security-events: write
    uses: go-openapi/ci-workflows/.github/workflows/codeql.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    secrets: inherit


================================================
FILE: .github/workflows/contributors.yml
================================================
name: Contributors

on:
  schedule:
    - cron: '18 4 * * 6'

  workflow_dispatch:

permissions:
  contents: read

jobs:
  contributors:
    permissions:
      pull-requests: write
      contents: write
    uses: go-openapi/ci-workflows/.github/workflows/contributors.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    secrets: inherit


================================================
FILE: .github/workflows/go-test.yml
================================================
name: go test

permissions:
  pull-requests: read
  contents: read

on:
  push:
    branches:
      - master

  pull_request:

jobs:
  test:
    uses: go-openapi/ci-workflows/.github/workflows/go-test-monorepo.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    secrets: inherit


================================================
FILE: .github/workflows/scanner.yml
================================================
name: Vulnerability scans

on:
  branch_protection_rule:
  push:
    branches: ["master"]
  schedule:
    - cron: "18 4 * * 3"

permissions:
  contents: read

jobs:
  scanners:
    permissions:
      contents: read
      security-events: write
    uses: go-openapi/ci-workflows/.github/workflows/scanner.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    secrets: inherit


================================================
FILE: .github/workflows/tag-release.yml
================================================
name: Release on tag

permissions:
  contents: read

on:
  push:
    tags:
      - v[0-9]+*

jobs:
  gh-release:
    name: Create release
    permissions:
      contents: write
    uses: go-openapi/ci-workflows/.github/workflows/release.yml@6ed4490472a56b1d952231565aac80f13c2d143c # v0.2.16
    with:
      tag: ${{ github.ref_name }}
      is-monorepo: true
    secrets: inherit


================================================
FILE: .gitignore
================================================
secrets.yml
vendor
Godeps
.idea
*.out
.mcp.json


================================================
FILE: .golangci.yml
================================================
version: "2"
linters:
  default: all
  disable:
    - cyclop
    - depguard
    - errchkjson
    - errorlint
    - exhaustruct
    - forcetypeassert
    - funlen
    - gochecknoglobals
    - gochecknoinits
    - gocognit
    - godot
    - godox
    - gomoddirectives
    - gosmopolitan
    - inamedparam
    - intrange
    - ireturn
    - lll
    - musttag
    - modernize
    - nestif
    - nlreturn
    - nonamedreturns
    - noinlineerr
    - paralleltest
    - recvcheck
    - testpackage
    - thelper
    - tagliatelle
    - tparallel
    - unparam
    - varnamelen
    - whitespace
    - wrapcheck
    - wsl
    - wsl_v5
  settings:
    dupl:
      threshold: 200
    goconst:
      min-len: 2
      min-occurrences: 3
    gocyclo:
      min-complexity: 45
  exclusions:
    generated: lax
    presets:
      - comments
      - common-false-positives
      - legacy
      - std-error-handling
    paths:
      - third_party$
      - builtin$
      - examples$
formatters:
  enable:
    - gofmt
    - goimports
  exclusions:
    generated: lax
    paths:
      - third_party$
      - builtin$
      - examples$
issues:
  # Maximum issues count per one linter.
  # Set to 0 to disable.
  # Default: 50
  max-issues-per-linter: 0
  # Maximum count of issues with the same text.
  # Set to 0 to disable.
  # Default: 3
  max-same-issues: 0


================================================
FILE: .mockery.yml
================================================
all: false
dir: '{{.InterfaceDir}}'
filename: mocks_test.go
force-file-write: true
formatter: goimports
include-auto-generated: false
log-level: info
structname: '{{.Mock}}{{.InterfaceName}}'
pkgname: '{{.SrcPackageName}}'
recursive: false
require-template-schema-exists: true
template: matryer
template-schema: '{{.Template}}.schema.json'
packages:
  github.com/go-openapi/swag/jsonutils/adapters/ifaces:
    config:
      dir: jsonutils/adapters/ifaces/mocks
      filename: mocks.go
      pkgname: 'mocks'
      force-file-write: true
      all: true
  github.com/go-openapi/swag/jsonutils/adapters/testintegration:
    config:
      inpackage: true
      dir: jsonutils/adapters/testintegration
      force-file-write: true
      all: true
    interfaces:
      EJMarshaler:
      EJUnmarshaler:


================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or

advances

* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <ivan+abuse@flanders.co.nz>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [<http://contributor-covenant.org/version/1/4>][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/


================================================
FILE: CONTRIBUTORS.md
================================================
# Contributors

- Repository: ['go-openapi/swag']

| Total Contributors | Total Contributions |
| --- | --- |
| 24  | 243  |

| Username | All Time Contribution Count | All Commits |
| --- | --- | --- |
| @fredbi | 113 | <https://github.com/go-openapi/swag/commits?author=fredbi> |
| @casualjim | 98 | <https://github.com/go-openapi/swag/commits?author=casualjim> |
| @alexandear | 4 | <https://github.com/go-openapi/swag/commits?author=alexandear> |
| @orisano | 3 | <https://github.com/go-openapi/swag/commits?author=orisano> |
| @reinerRubin | 2 | <https://github.com/go-openapi/swag/commits?author=reinerRubin> |
| @n-inja | 2 | <https://github.com/go-openapi/swag/commits?author=n-inja> |
| @nitinmohan87 | 2 | <https://github.com/go-openapi/swag/commits?author=nitinmohan87> |
| @Neo2308 | 2 | <https://github.com/go-openapi/swag/commits?author=Neo2308> |
| @michaelbowler-form3 | 2 | <https://github.com/go-openapi/swag/commits?author=michaelbowler-form3> |
| @ujjwalsh | 1 | <https://github.com/go-openapi/swag/commits?author=ujjwalsh> |
| @griffin-stewie | 1 | <https://github.com/go-openapi/swag/commits?author=griffin-stewie> |
| @POD666 | 1 | <https://github.com/go-openapi/swag/commits?author=POD666> |
| @pytlesk4 | 1 | <https://github.com/go-openapi/swag/commits?author=pytlesk4> |
| @shirou | 1 | <https://github.com/go-openapi/swag/commits?author=shirou> |
| @seanprince | 1 | <https://github.com/go-openapi/swag/commits?author=seanprince> |
| @petrkotas | 1 | <https://github.com/go-openapi/swag/commits?author=petrkotas> |
| @mszczygiel | 1 | <https://github.com/go-openapi/swag/commits?author=mszczygiel> |
| @sosiska | 1 | <https://github.com/go-openapi/swag/commits?author=sosiska> |
| @kzys | 1 | <https://github.com/go-openapi/swag/commits?author=kzys> |
| @faguirre1 | 1 | <https://github.com/go-openapi/swag/commits?author=faguirre1> |
| @posener | 1 | <https://github.com/go-openapi/swag/commits?author=posener> |
| @diego-fu-hs | 1 | <https://github.com/go-openapi/swag/commits?author=diego-fu-hs> |
| @davidalpert | 1 | <https://github.com/go-openapi/swag/commits?author=davidalpert> |
| @Xe | 1 | <https://github.com/go-openapi/swag/commits?author=Xe> |

 _this file was generated by the [Contributors GitHub Action](https://github.com/github-community-projects/contributors)_


================================================
FILE: LICENSE
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README.md
================================================
# Swag

<!-- Badges: status  -->
[![Tests][test-badge]][test-url] [![Coverage][cov-badge]][cov-url] [![CI vuln scan][vuln-scan-badge]][vuln-scan-url] [![CodeQL][codeql-badge]][codeql-url]
<!-- Badges: release & docker images  -->
<!-- Badges: code quality  -->
<!-- Badges: license & compliance -->
[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url]
<!-- Badges: documentation & support -->
<!-- Badges: others & stats -->
[![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge]

---

A bunch of helper functions for go-openapi and go-swagger projects.

You may also use it standalone for your projects.

> **NOTE**
> `swag` is one of the foundational building blocks of the go-openapi initiative.
>
> Most repositories in `github.com/go-openapi/...` depend on it in some way.
> And so does our CLI tool `github.com/go-swagger/go-swagger`,
> as well as the code generated by this tool.

* [Contents](#contents)
* [Dependencies](#dependencies)
* [Change log](#change-log)
* [Licensing](#licensing)
* [Note to contributors](#note-to-contributors)
* [Roadmap](#roadmap)

## Announcements

* **2025-12-19** : new community chat on discord
  * a new discord community channel is available to be notified of changes and support users
  * our venerable Slack channel remains open, and will be eventually discontinued on **2026-03-31**

You may join the discord community by clicking the invite link on the discord badge (also above). [![Discord Channel][discord-badge]][discord-url]

Or join our Slack channel: [![Slack Channel][slack-logo]![slack-badge]][slack-url]

## Status

API is stable.

## Import this library in your project

```cmd
go get github.com/go-openapi/swag/{module}
```

Or for backward compatibility:

```cmd
go get github.com/go-openapi/swag
```

## Contents

`go-openapi/swag` exposes a collection of relatively independent modules.

Moving forward, no additional feature will be added to the `swag` API directly at the root package level,
which remains there for backward-compatibility purposes. All exported top-level features are now deprecated.

Child modules will continue to evolve and some new ones may be added in the future.

| Module        | Content | Main features |
|---------------|---------|---------------|
| `cmdutils`     | utilities to work with CLIs ||
| `conv`        | type conversion utilities | convert between values and pointers for any types<br />convert from string to builtin types (wraps `strconv`)<br />require `./typeutils` (test dependency)<br /> |
| `fileutils`   | file utilities | |
| `jsonname`    | JSON utilities | infer JSON names from `go` properties<br /> |
| `jsonutils`   | JSON utilities | fast json concatenation<br />read and write JSON from and to dynamic `go` data structures<br />~require `github.com/mailru/easyjson`~<br /> |
| `loading`     | file loading | load from file or http<br />require `./yamlutils`<br /> |
| `mangling`    | safe name generation | name mangling for `go`<br /> |
| `netutils`    | networking utilities | host, port from address<br /> |
| `stringutils` | `string` utilities | search in slice (with case-insensitive)<br />split/join query parameters as arrays<br /> |
| `typeutils`   | `go` types utilities | check the zero value for any type<br />safe check for a nil value<br /> |
| `yamlutils`   | YAML utilities | converting YAML to JSON<br />loading YAML into a dynamic YAML document<br />maintaining the original order of keys in YAML objects<br />require `./jsonutils`<br />~require `github.com/mailru/easyjson`~<br />require `go.yaml.in/yaml/v3`<br /> |

---

## Dependencies

The root module `github.com/go-openapi/swag` at the repo level maintains a few
dependencies outside of the standard library.

* YAML utilities depend on `go.yaml.in/yaml/v3`
* JSON utilities depend on their registered adapter module:
    * by default, only the standard library is used
    * `github.com/mailru/easyjson` is now only a dependency for module
      `github.com/go-openapi/swag/jsonutils/adapters/easyjson/json`,
      for users willing to import that module.
    * integration tests and benchmarks use all the dependencies are published as their own module
* other dependencies are test dependencies drawn from `github.com/stretchr/testify`

## Usage

**How to explicitly register a dependency at runtime**?

The following would maintain how JSON utilities proposed by `swag` used work, up to `v0.24.1`.

  ```go
  import (
    "github.com/go-openapi/swag/jsonutils/adapters"
    easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json"
  )

  func init() {
	  easyjson.Register(adapters.Registry)
  }
  ```

Subsequent calls to `jsonutils.ReadJSON()` or `jsonutils.WriteJSON()` will switch to `easyjson`
whenever the passed data structures implement the `easyjson.Unmarshaler` or `easyjson.Marshaler` respectively,
or fallback to the standard library.

For more details, you may also look at our
[integration tests](jsonutils/adapters/testintegration/integration_suite_test.go#29).

---

## Note to contributors

All kinds of contributions are welcome.

This repo is a go mono-repo. See [docs](docs/MAINTAINERS.md).

More general guidelines are available [here](.github/CONTRIBUTING.md).

## Roadmap

See the current [TODO list](docs/TODOS.md)

## Change log

See <https://github.com/go-openapi/swag/releases>

For pre-v0.26.0 releases, see [release notes](./docs/NOTES.md).

**What coming next?**

Moving forward, we want to :

* provide an implementation of the JSON adapter based on `encoding/json/v2`, for `go1.25` builds.
* provide similar implementations for `goccy/go-json` and `jsoniterator/go`, and perhaps some other
  similar libraries may be interesting too.

<!--

## References

-->

## Licensing

This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE).

<!--
See the license [NOTICE](./NOTICE), which recalls the licensing terms of all the pieces of software
on top of which it has been built.
-->

<!--

## Limitations

-->

## Other documentation

* [All-time contributors](./CONTRIBUTORS.md)
* [Contributing guidelines](.github/CONTRIBUTING.md)
* [Maintainers documentation](docs/MAINTAINERS.md)
* [Code style](docs/STYLE.md)

## Cutting a new release

Maintainers can cut a new release by either:

* running [this workflow](https://github.com/go-openapi/swag/actions/workflows/bump-release.yml)
* or pushing a semver tag
  * signed tags are preferred
  * The tag message is prepended to release notes

<!-- Badges: status  -->
[test-badge]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml/badge.svg
[test-url]: https://github.com/go-openapi/swag/actions/workflows/go-test.yml
[cov-badge]: https://codecov.io/gh/go-openapi/swag/branch/master/graph/badge.svg
[cov-url]: https://codecov.io/gh/go-openapi/swag
[vuln-scan-badge]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml/badge.svg
[vuln-scan-url]: https://github.com/go-openapi/swag/actions/workflows/scanner.yml
[codeql-badge]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml/badge.svg
[codeql-url]: https://github.com/go-openapi/swag/actions/workflows/codeql.yml
<!-- Badges: release & docker images  -->
[release-badge]: https://badge.fury.io/gh/go-openapi%2Fswag.svg
[release-url]: https://badge.fury.io/gh/go-openapi%2Fswag
[gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag.svg
[gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fswag
<!-- Badges: code quality  -->
[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/swag
[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/swag
[codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/swag
[codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/swag
<!-- Badges: documentation & support -->
[doc-badge]: https://img.shields.io/badge/doc-site-blue?link=https%3A%2F%2Fgoswagger.io%2Fgo-openapi%2F
[doc-url]: https://goswagger.io/go-openapi
[godoc-badge]: https://pkg.go.dev/badge/github.com/go-openapi/swag
[godoc-url]: http://pkg.go.dev/github.com/go-openapi/swag
[slack-logo]: https://a.slack-edge.com/e6a93c1/img/icons/favicon-32.png
[slack-badge]: https://img.shields.io/badge/slack-blue?link=https%3A%2F%2Fgoswagger.slack.com%2Farchives%2FC04R30YM
[slack-url]: https://goswagger.slack.com/archives/C04R30YMU
[discord-badge]: https://img.shields.io/discord/1446918742398341256?logo=discord&label=discord&color=blue
[discord-url]: https://discord.gg/FfnFYaC3k5

<!-- Badges: license & compliance -->
[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg
[license-url]: https://github.com/go-openapi/swag/?tab=Apache-2.0-1-ov-file#readme
<!-- Badges: others & stats -->
[goversion-badge]: https://img.shields.io/github/go-mod/go-version/go-openapi/swag
[goversion-url]: https://github.com/go-openapi/swag/blob/master/go.mod
[top-badge]: https://img.shields.io/github/languages/top/go-openapi/swag
[commits-badge]: https://img.shields.io/github/commits-since/go-openapi/swag/latest


================================================
FILE: SECURITY.md
================================================
# Security Policy

This policy outlines the commitment and practices of the go-openapi maintainers regarding security.

## Supported Versions

| Version | Supported          |
| ------- | ------------------ |
| O.x     | :white_check_mark: |

## Vulnerability checks in place

This repository uses automated vulnerability scans, at every merged commit and at least once a week.

We use:

* [`GitHub CodeQL`][codeql-url]
* [`trivy`][trivy-url]
* [`govulncheck`][govulncheck-url]

Reports are centralized in github security reports and visible only to the maintainers.

## Reporting a vulnerability

If you become aware of a security vulnerability that affects the current repository,
**please report it privately to the maintainers**
rather than opening a publicly visible GitHub issue.

Please follow the instructions provided by github to [Privately report a security vulnerability][github-guidance-url].

> [!NOTE]
> On Github, navigate to the project's "Security" tab then click on "Report a vulnerability".

[codeql-url]: https://github.com/github/codeql
[trivy-url]: https://trivy.dev/docs/latest/getting-started
[govulncheck-url]: https://go.dev/blog/govulncheck
[github-guidance-url]: https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability


================================================
FILE: cmdutils/cmd_utils.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package cmdutils

// CommandLineOptionsGroup represents a group of user-defined command line options.
//
// This is for instance used to configure command line arguments in API servers generated by go-swagger.
type CommandLineOptionsGroup struct {
	ShortDescription string
	LongDescription  string
	Options          any
}


================================================
FILE: cmdutils/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package cmdutils brings helpers for CLIs produced by go-openapi
package cmdutils


================================================
FILE: cmdutils/go.mod
================================================
module github.com/go-openapi/swag/cmdutils

go 1.25.0


================================================
FILE: cmdutils/go.sum
================================================


================================================
FILE: cmdutils_iface.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import "github.com/go-openapi/swag/cmdutils"

// CommandLineOptionsGroup represents a group of user-defined command line options.
//
// Deprecated: use [cmdutils.CommandLineOptionsGroup] instead.
type CommandLineOptionsGroup = cmdutils.CommandLineOptionsGroup


================================================
FILE: cmdutils_iface_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag


================================================
FILE: conv/convert.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

import (
	"math"
	"strconv"
	"strings"
)

// same as ECMA Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER
const (
	maxJSONFloat         = float64(1<<53 - 1)  // 9007199254740991.0 	 	 2^53 - 1
	minJSONFloat         = -float64(1<<53 - 1) //-9007199254740991.0	-2^53 - 1
	epsilon      float64 = 1e-9
)

// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
func IsFloat64AJSONInteger(f float64) bool {
	if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
		return false
	}
	rounded := math.Round(f)
	if f == rounded {
		return true
	}
	if rounded == 0 { // f = 0.0 exited above
		return false
	}

	diff := math.Abs(f - rounded)
	if diff == 0 {
		return true
	}

	// relative error Abs{f - Round(f)) / Round(f)} < ε ; Round(f)
	return diff < epsilon*math.Abs(rounded)
}

// ConvertFloat turns a string into a float numerical value.
func ConvertFloat[T Float](str string) (T, error) {
	var v T
	f, err := strconv.ParseFloat(str, bitsize(v))
	if err != nil {
		return 0, err
	}

	return T(f), nil
}

// ConvertInteger turns a string into a signed integer.
func ConvertInteger[T Signed](str string) (T, error) {
	var v T
	f, err := strconv.ParseInt(str, 10, bitsize(v))
	if err != nil {
		return 0, err
	}

	return T(f), nil
}

// ConvertUinteger turns a string into an unsigned integer.
func ConvertUinteger[T Unsigned](str string) (T, error) {
	var v T
	f, err := strconv.ParseUint(str, 10, bitsize(v))
	if err != nil {
		return 0, err
	}

	return T(f), nil
}

// ConvertBool turns a string into a boolean.
//
// It supports a few more "true" strings than [strconv.ParseBool]:
//
//   - it is not case sensitive ("trUe" or "FalsE" work)
//   - "ok", "yes", "y", "on", "selected", "checked", "enabled" are all true
//   - everything that is not true is false: there is never an actual error returned
func ConvertBool(str string) (bool, error) {
	switch strings.ToLower(str) {
	case "true",
		"1",
		"yes",
		"ok",
		"y",
		"on",
		"selected",
		"checked",
		"t",
		"enabled":
		return true, nil
	default:
		return false, nil
	}
}

// ConvertFloat32 turns a string into a float32.
func ConvertFloat32(str string) (float32, error) { return ConvertFloat[float32](str) }

// ConvertFloat64 turns a string into a float64
func ConvertFloat64(str string) (float64, error) { return ConvertFloat[float64](str) }

// ConvertInt8 turns a string into an int8
func ConvertInt8(str string) (int8, error) { return ConvertInteger[int8](str) }

// ConvertInt16 turns a string into an int16
func ConvertInt16(str string) (int16, error) {
	i, err := strconv.ParseInt(str, 10, 16)
	if err != nil {
		return 0, err
	}
	return int16(i), nil
}

// ConvertInt32 turns a string into an int32
func ConvertInt32(str string) (int32, error) {
	i, err := strconv.ParseInt(str, 10, 32)
	if err != nil {
		return 0, err
	}
	return int32(i), nil
}

// ConvertInt64 turns a string into an int64
func ConvertInt64(str string) (int64, error) {
	return strconv.ParseInt(str, 10, 64)
}

// ConvertUint8 turns a string into an uint8
func ConvertUint8(str string) (uint8, error) {
	i, err := strconv.ParseUint(str, 10, 8)
	if err != nil {
		return 0, err
	}
	return uint8(i), nil
}

// ConvertUint16 turns a string into an uint16
func ConvertUint16(str string) (uint16, error) {
	i, err := strconv.ParseUint(str, 10, 16)
	if err != nil {
		return 0, err
	}
	return uint16(i), nil
}

// ConvertUint32 turns a string into an uint32
func ConvertUint32(str string) (uint32, error) {
	i, err := strconv.ParseUint(str, 10, 32)
	if err != nil {
		return 0, err
	}
	return uint32(i), nil
}

// ConvertUint64 turns a string into an uint64
func ConvertUint64(str string) (uint64, error) {
	return strconv.ParseUint(str, 10, 64)
}


================================================
FILE: conv/convert_format_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

import (
	"fmt"
	"io"
	"math"
	"math/big"
	"math/bits"
	"slices"
	"strconv"
	"strings"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

var evaluatesAsTrue = map[string]struct{}{
	"true":     {},
	"1":        {},
	"yes":      {},
	"ok":       {},
	"y":        {},
	"on":       {},
	"selected": {},
	"checked":  {},
	"t":        {},
	"enabled":  {},
}

func TestConvertBool(t *testing.T) {
	for k := range evaluatesAsTrue {
		r, err := ConvertBool(k)
		require.NoError(t, err)
		assert.TrueT(t, r)
	}
	for _, k := range []string{"a", "", "0", "false", "unchecked", "anythingElse"} {
		r, err := ConvertBool(k)
		require.NoError(t, err)
		assert.FalseT(t, r)
	}
}

func TestFormatBool(t *testing.T) {
	assert.EqualT(t, "true", FormatBool(true))
	assert.EqualT(t, "false", FormatBool(false))
}

func TestConvertFloat(t *testing.T) {
	t.Run("with float32", func(t *testing.T) {
		validFloats := []float32{1.0, -1, math.MaxFloat32, math.SmallestNonzeroFloat32, 0, 5.494430303}
		invalidFloats := []string{"a", strconv.FormatFloat(math.MaxFloat64, 'f', -1, 64), "true", float64OverflowStr()}

		for _, f := range validFloats {
			str := FormatFloat(f)
			c1, err := ConvertFloat32(str)
			require.NoError(t, err)
			assert.InDeltaT(t, f, c1, 1e-6)

			c2, err := ConvertFloat[float32](str)
			require.NoError(t, err)
			assert.InDeltaT(t, c1, c2, 1e-6)
		}

		for _, f := range invalidFloats {
			_, err := ConvertFloat32(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertFloat[float32](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with float64", func(t *testing.T) {
		validFloats := []float64{1.0, -1, float64(math.MaxFloat32), float64(math.SmallestNonzeroFloat32), math.MaxFloat64, math.SmallestNonzeroFloat64, 0, 5.494430303}
		invalidFloats := []string{"a", "true", float64OverflowStr()}

		for _, f := range validFloats {
			str := FormatFloat(f)
			c1, err := ConvertFloat64(str)
			require.NoError(t, err)
			assert.InDeltaT(t, f, c1, 1e-6)

			c2, err := ConvertFloat64(str)
			require.NoError(t, err)
			assert.InDeltaT(t, c1, c2, 1e-6)
		}

		for _, f := range invalidFloats {
			_, err := ConvertFloat64(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertFloat[float64](f)
			require.Error(t, err, testErrMsg(f))
		}
	})
}

func TestConvertInteger(t *testing.T) {
	t.Run("with int8", func(t *testing.T) {
		validInts := []int8{0, 1, -1, math.MaxInt8, math.MinInt8}
		invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}

		for _, f := range validInts {
			str := FormatInteger(f)
			c1, err := ConvertInt8(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertInteger[int8](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidInts {
			_, err := ConvertInt8(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertInteger[int8](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with int16", func(t *testing.T) {
		validInts := []int16{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16}
		invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}

		for _, f := range validInts {
			str := FormatInteger(f)
			c1, err := ConvertInt16(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertInteger[int16](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidInts {
			_, err := ConvertInt16(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertInteger[int16](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with int32", func(t *testing.T) {
		validInts := []int32{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16, math.MinInt32, math.MaxInt32}
		invalidInts := []string{"1.233", "a", "false", strconv.FormatInt(int64(math.MaxInt64), 10)}

		for _, f := range validInts {
			str := FormatInteger(f)
			c1, err := ConvertInt32(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertInteger[int32](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidInts {
			_, err := ConvertInt32(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertInteger[int32](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with int64", func(t *testing.T) {
		validInts := []int64{0, 1, -1, math.MaxInt8, math.MinInt8, math.MaxInt16, math.MinInt16, math.MinInt32, math.MaxInt32, math.MaxInt64, math.MinInt64}
		invalidInts := []string{"1.233", "a", "false"}

		for _, f := range validInts {
			str := FormatInteger(f)
			c1, err := ConvertInt64(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertInt64(str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidInts {
			_, err := ConvertInt64(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertInteger[int64](f)
			require.Error(t, err, testErrMsg(f))
		}
	})
}

func TestConvertUinteger(t *testing.T) {
	t.Run("with uint8", func(t *testing.T) {
		validInts := []uint8{0, 1, math.MaxUint8}
		invalidInts := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10), "-1"}

		for _, f := range validInts {
			str := FormatUinteger(f)
			c1, err := ConvertUint8(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertUinteger[uint8](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidInts {
			_, err := ConvertUint8(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertUinteger[uint8](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with uint16", func(t *testing.T) {
		validUints := []uint16{0, 1, math.MaxUint8, math.MaxUint16}
		invalidUints := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10), strconv.FormatInt(-1, 10)}

		for _, f := range validUints {
			str := FormatUinteger(f)
			c1, err := ConvertUint16(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertUinteger[uint16](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidUints {
			_, err := ConvertUint16(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertUinteger[uint16](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with uint32", func(t *testing.T) {
		validUints := []uint32{0, 1, math.MaxUint8, math.MaxUint16, math.MaxUint32}
		invalidUints := []string{"1.233", "a", "false", strconv.FormatUint(math.MaxUint64, 10), strconv.FormatInt(-1, 10)}

		for _, f := range validUints {
			str := FormatUinteger(f)
			c1, err := ConvertUint32(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertUint32(str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}

		for _, f := range invalidUints {
			_, err := ConvertUint32(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertUinteger[uint32](f)
			require.Error(t, err, testErrMsg(f))
		}
	})

	t.Run("with uint64", func(t *testing.T) {
		validUints := []uint64{0, 1, math.MaxUint8, math.MaxUint16, math.MaxUint32, math.MaxUint64}
		invalidUints := []string{"1.233", "a", "false", strconv.FormatInt(-1, 10), uint64OverflowStr()}

		for _, f := range validUints {
			str := FormatUinteger(f)
			c1, err := ConvertUint64(str)
			require.NoError(t, err)
			assert.EqualT(t, f, c1)

			c2, err := ConvertUinteger[uint64](str)
			require.NoError(t, err)
			assert.EqualT(t, c1, c2)
		}
		for _, f := range invalidUints {
			_, err := ConvertUint64(f)
			require.Error(t, err, testErrMsg(f))

			_, err = ConvertUinteger[uint64](f)
			require.Error(t, err, testErrMsg(f))
		}
	})
}

func TestIsFloat64AJSONInteger(t *testing.T) {
	t.Run("should not be integers", testNotIntegers(IsFloat64AJSONInteger, false))
	t.Run("should be integers", testIntegers(IsFloat64AJSONInteger, false))
}

func TestPreviousIsFloat64AJSONInteger(t *testing.T) {
	t.Run("should not be integers", testNotIntegers(previousIsFloat64JSONInteger, false))
	t.Run("should be integers", testIntegers(previousIsFloat64JSONInteger, true))
}

func TestBitWiseIsFloat64AJSONInteger(t *testing.T) {
	t.Run("should not be integers", testNotIntegers(bitwiseIsFloat64JSONInteger, false))
	t.Run("should be integers", testIntegers(bitwiseIsFloat64JSONInteger, false))
}

func TestBitWise2IsFloat64AJSONInteger(t *testing.T) {
	t.Run("should not be integers", testNotIntegers(bitwiseIsFloat64JSONInteger2, false))
	t.Run("should be integers", testIntegers(bitwiseIsFloat64JSONInteger2, false))
}

func TestStdlib2IsFloat64AJSONInteger(t *testing.T) {
	t.Run("should not be integers", testNotIntegers(stdlibIsFloat64JSONInteger, true))
	t.Run("should be integers", testIntegers(stdlibIsFloat64JSONInteger, true))
}

func testNotIntegers(fn func(float64) bool, skipKnownFailure bool) func(*testing.T) {
	_ = skipKnownFailure

	return func(t *testing.T) {
		assert.FalseT(t, fn(math.Inf(1)))
		assert.FalseT(t, fn(maxJSONFloat+1))
		assert.FalseT(t, fn(minJSONFloat-1))
		assert.FalseT(t, fn(math.SmallestNonzeroFloat64))
		assert.FalseT(t, fn(0.5))
		assert.FalseT(t, fn(0.25))
		assert.FalseT(t, fn(1.00/func() float64 { return 2.00 }()))
		assert.FalseT(t, fn(1.00/func() float64 { return 4.00 }()))
		assert.FalseT(t, fn(epsilon))
	}
}

func testIntegers(fn func(float64) bool, skipKnownFailure bool) func(*testing.T) {
	// wrapping in a function forces non-constant evaluation to test float64 rounding behavior
	return func(t *testing.T) {
		assert.TrueT(t, fn(0.0))
		assert.TrueT(t, fn(1.0))
		assert.TrueT(t, fn(maxJSONFloat))
		assert.TrueT(t, fn(minJSONFloat))
		if !skipKnownFailure {
			assert.TrueT(t, fn(1/0.01*67.15000001))
		}
		if !skipKnownFailure {
			assert.TrueT(t, fn(1.00/func() float64 { return 0.01 }()*4643.4))
		}
		assert.TrueT(t, fn(1.00/func() float64 { return 1.00 / 3.00 }()))
		assert.TrueT(t, fn(math.SmallestNonzeroFloat64/2))
		assert.TrueT(t, fn(math.SmallestNonzeroFloat64/3))
		assert.TrueT(t, fn(math.SmallestNonzeroFloat64/4))
	}
}

func BenchmarkIsFloat64JSONInteger(b *testing.B) {
	b.ResetTimer()
	b.ReportAllocs()
	b.SetBytes(0)

	b.Run("new float vs integer comparison", benchmarkIsFloat64JSONInteger(IsFloat64AJSONInteger))
	b.Run("previous float vs integer comparison", benchmarkIsFloat64JSONInteger(previousIsFloat64JSONInteger))
	b.Run("bitwise float vs integer comparison", benchmarkIsFloat64JSONInteger(bitwiseIsFloat64JSONInteger))
	b.Run("bitwise float vs integer comparison (2)", benchmarkIsFloat64JSONInteger(bitwiseIsFloat64JSONInteger2))
	b.Run("stdlib float vs integer comparison (2)", benchmarkIsFloat64JSONInteger(stdlibIsFloat64JSONInteger))
}

func BenchmarkBitwise(b *testing.B) {
	b.ResetTimer()
	b.ReportAllocs()
	b.SetBytes(0)

	b.Run("bitwise float vs integer comparison (2)", benchmarkIsFloat64JSONInteger(bitwiseIsFloat64JSONInteger2))
}

func previousIsFloat64JSONInteger(f float64) bool {
	if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
		return false
	}
	fa := math.Abs(f)
	g := float64(uint64(f))
	ga := math.Abs(g)

	diff := math.Abs(f - g)

	// more info: https://floating-point-gui.de/errors/comparison/#look-out-for-edge-cases
	switch {
	case f == g: // best case
		return true
	case f == float64(int64(f)) || f == float64(uint64(f)): // optimistic case
		return true
	case f == 0 || g == 0 || diff < math.SmallestNonzeroFloat64: // very close to 0 values
		return diff < (epsilon * math.SmallestNonzeroFloat64)
	}
	// check the relative error
	return diff/math.Min(fa+ga, math.MaxFloat64) < epsilon
}

func stdlibIsFloat64JSONInteger(f float64) bool {
	if f < minJSONFloat || f > maxJSONFloat {
		return false
	}
	var bf big.Float
	bf.SetFloat64(f)

	return bf.IsInt()
}

func bitwiseIsFloat64JSONInteger(f float64) bool {
	if math.IsNaN(f) || math.IsInf(f, 0) || f < minJSONFloat || f > maxJSONFloat {
		return false
	}

	mant, exp := math.Frexp(f) // get normalized mantissa
	if exp == 0 && mant == 0 {
		return true
	}
	if exp <= 0 {
		return false
	}

	zeros := bits.TrailingZeros64(uint64(mant))

	return bits.UintSize-zeros <= exp
}

func bitwiseIsFloat64JSONInteger2(f float64) bool {
	if f == 0 {
		return true
	}

	if f < minJSONFloat || f > maxJSONFloat || f != f || f < -math.MaxFloat64 || f > math.MaxFloat64 {
		return false
	}

	// inlined
	var (
		mant uint64
		exp  int
	)
	{
		const smallestNormal = 2.2250738585072014e-308 // 2**-1022

		if math.Abs(f) < smallestNormal {
			f *= (1 << shift) // x 2^52
			exp = -shift
		}

		x := math.Float64bits(f)
		exp += int((x>>shift)&mask) - bias + 1 //nolint:gosec // x>>12 & 0x7FF - 1022 : extract exp, recentered from bias

		x &^= mask << shift       // x= x &^ 0x7FF << 12 (clear 11 exp bits then shift 12)
		x |= (-1 + bias) << shift // x = x | 1022 << 12 ==> or with 1022 as exp location
		mant = uint64(math.Float64frombits(x))
	}
	/*
		{
			x := math.Float64bits(f)
			exp = int(x>>shift) & mask

			if exp < bias {
			} else if exp < bias+shift { // 1023 + 12
				exp -= bias
			}
		}
	*/
	/*
		e := uint(bits>>shift) & mask
		if e < bias {
			// Round abs(x) < 1 including denormals.
			bits &= signMask // +-0
			if e == bias-1 {
				bits |= uvone // +-1
			}
		} else if e < bias+shift {
			// Round any abs(x) >= 1 containing a fractional component [0,1).
			//
			// Numbers with larger exponents are returned unchanged since they
			// must be either an integer, infinity, or NaN.
			const half = 1 << (shift - 1)
			e -= bias
			bits += half >> e
			bits &^= fracMask >> e
		}
	*/

	// It returns frac and exp satisfying f == frac × 2**exp,
	// with the absolute value of frac in the interval [½, 1).
	if exp <= 0 {
		return false
	}

	zeros := bits.TrailingZeros64(mant)

	return bits.UintSize-zeros <= exp
}

const (
	mask  = 0x7FF
	shift = 64 - 11 - 1
	// uvinf    = 0x7FF0000000000000
	// uvneginf = 0xFFF0000000000000
	bias     = 1023
	fracMask = 1<<shift - 1
)

/*
func isNaN(x uint64) bool { // f != f
	return uint32(x>>shift)&mask == mask // && x != uvinf && x != uvneginf
}

func isInf(x uint64) bool { // f < - math.MaxFloat || f > math.MaxFloat
	return x == uvinf || x == uvneginf
}
*/

/*
func frexp(f float64) (frac uint64, exp int) {
	const smallestNormal = 2.2250738585072014e-308 // 2**-1022
	g := f

	if math.Abs(f) < smallestNormal {
		g *= (1 << 52)
		exp = -52
	}

	x := math.Float64bits(g)
	exp += int((x>>shift)&mask) - bias + 1
	x &^= mask << shift
	x |= (-1 + bias) << shift
	frac = uint64(math.Float64frombits(x))

	return
}
*/

func benchmarkIsFloat64JSONInteger(fn func(float64) bool) func(*testing.B) {
	assertCode := func() {
		panic("unexpected result during benchmark")
	}

	return func(b *testing.B) {
		testFunc := func() {
			if fn(math.Inf(1)) {
				assertCode()
			}
			if fn(maxJSONFloat + 1) {
				assertCode()
			}
			if fn(minJSONFloat - 1) {
				assertCode()
			}
			if fn(math.SmallestNonzeroFloat64) {
				assertCode()
			}
			if fn(0.5) {
				assertCode()
			}

			if !fn(1.0) {
				assertCode()
			}
			if !fn(maxJSONFloat) {
				assertCode()
			}
			if !fn(minJSONFloat) {
				assertCode()
			}
			if !fn(1 / 0.01 * 67.15000001) {
				assertCode()
			}
			/* can't compare both versions on this test case
			if !fn(1 / func() float64 { return 0.01 }() * 4643.4) {
				assertCode()
			}
			*/
			if !fn(math.SmallestNonzeroFloat64 / 2) {
				assertCode()
			}
			if !fn(math.SmallestNonzeroFloat64 / 3) {
				assertCode()
			}
			if !fn(math.SmallestNonzeroFloat64 / 4) {
				assertCode()
			}
		}

		for n := 0; n < b.N; n++ {
			testFunc()
		}
	}
}

// test utilities

func testErrMsg(f string) string {
	const (
		expectedQuote = "expected '"
		errSuffix     = "' to generate an error"
	)

	return expectedQuote + f + errSuffix
}

func uint64OverflowStr() string {
	var one, maxUint, overflow big.Int
	one.SetUint64(1)
	maxUint.SetUint64(math.MaxUint64)
	overflow.Add(&maxUint, &one)

	return overflow.String()
}

func float64OverflowStr() string {
	var one, maxFloat64, overflow big.Float
	one.SetFloat64(1.00)
	maxFloat64.SetFloat64(math.MaxFloat64)
	overflow.Add(&maxFloat64, &one)

	return overflow.String()
}

// benchmarks
func BenchmarkConvertBool(b *testing.B) {
	inputs := []string{
		"a", "t", "ok", "false", "true", "TRUE", "no", "n", "y",
	}
	var isTrue bool

	b.ReportAllocs()
	b.ResetTimer()

	b.Run("use switch", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			isTrue, _ = ConvertBool(inputs[i%len(inputs)])
		}
		fmt.Fprintln(io.Discard, isTrue)
	})

	b.Run("use map (previous version)", func(b *testing.B) {
		previousConvertBool := func(str string) (bool, error) {
			_, ok := evaluatesAsTrue[strings.ToLower(str)]
			return ok, nil
		}

		for i := 0; i < b.N; i++ {
			isTrue, _ = previousConvertBool(inputs[i%len(inputs)])
		}
		fmt.Fprintln(io.Discard, isTrue)
	})

	b.Run("use slice.Contains", func(b *testing.B) {
		sliceContainsConvertBool := func(str string) (bool, error) {
			return slices.Contains(
				[]string{"true", "1", "yes", "ok", "y", "on", "selected", "checked", "t", "enabled"},
				strings.ToLower(str),
			), nil
		}

		for i := 0; i < b.N; i++ {
			isTrue, _ = sliceContainsConvertBool(inputs[i%len(inputs)])
		}
		fmt.Fprintln(io.Discard, isTrue)
	})
}


================================================
FILE: conv/convert_types.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

// Unlicensed credits (idea, concept)
//
// The idea to convert values to pointers and the other way around, was inspired, eons ago, by the aws go sdk.
//
// Nowadays, all sensible API sdk's expose a similar functionality.

// Pointer returns a pointer to the value passed in.
func Pointer[T any](v T) *T {
	return &v
}

// Value returns a shallow copy of the value of the pointer passed in.
//
// If the pointer is nil, the returned value is the zero value.
func Value[T any](v *T) T {
	if v != nil {
		return *v
	}

	var zero T
	return zero
}

// PointerSlice converts a slice of values into a slice of pointers.
func PointerSlice[T any](src []T) []*T {
	dst := make([]*T, len(src))
	for i := 0; i < len(src); i++ {
		dst[i] = &(src[i])
	}
	return dst
}

// ValueSlice converts a slice of pointers into a slice of values.
//
// nil elements are zero values.
func ValueSlice[T any](src []*T) []T {
	dst := make([]T, len(src))
	for i := 0; i < len(src); i++ {
		if src[i] != nil {
			dst[i] = *(src[i])
		}
	}
	return dst
}

// PointerMap converts a map of values into a map of pointers.
func PointerMap[K comparable, T any](src map[K]T) map[K]*T {
	dst := make(map[K]*T)
	for k, val := range src {
		v := val
		dst[k] = &v
	}
	return dst
}

// ValueMap converts a map of pointers into a map of values.
//
// nil elements are skipped.
func ValueMap[K comparable, T any](src map[K]*T) map[K]T {
	dst := make(map[K]T)
	for k, val := range src {
		if val != nil {
			dst[k] = *val
		}
	}
	return dst
}


================================================
FILE: conv/convert_types_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

import (
	"reflect"
	"testing"

	"github.com/go-openapi/swag/typeutils"
	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

const (
	wantsPointer = true
	wantsValue   = false
)

func TestSlice(t *testing.T) {
	t.Run("with nulls, should skip null map entries", func(t *testing.T) {
		require.Empty(t, ValueSlice[uint16](nil))

		require.Len(t, ValueSlice([]*uint16{Pointer(uint16(1)), nil, Pointer(uint16(2))}), 3)
	})

	t.Run("with PointerSlice on []string", func(t *testing.T) {
		testCasesStringSlice := [][]string{
			{"a", "b", "c", "d", "e"},
			{"a", "b", "", "", "e"},
		}

		for idx, in := range testCasesStringSlice {
			if in == nil {
				continue
			}
			out := PointerSlice(in)
			assertValues(t, in, out, wantsPointer, idx)

			out2 := ValueSlice(out)
			assertValues(t, in, out2, wantsValue, idx)
		}
	})

	t.Run("with ValueSlice on []string", func(t *testing.T) {
		testCasesStringValueSlice := [][]*string{
			{Pointer("a"), Pointer("b"), nil, Pointer("c")},
		}

		for idx, in := range testCasesStringValueSlice {
			if in == nil {
				continue
			}
			out := ValueSlice(in)
			assertValues(t, in, out, wantsValue, idx)

			out2 := PointerSlice(out)
			assertValues(t, in, out2, wantsPointer, idx)
		}
	})
}

func TestMap(t *testing.T) {
	t.Run("with nulls", func(t *testing.T) {
		require.Empty(t, ValueMap[string, uint16](nil))

		require.Len(t, ValueMap(map[string]*int{"a": Pointer(1), "b": nil, "c": Pointer(2)}), 2)
	})

	t.Run("with PointerMap on map[string]string", func(t *testing.T) {
		testCasesStringMap := []map[string]string{
			{"a": "1", "b": "2", "c": "3"},
		}

		for idx, in := range testCasesStringMap {
			if in == nil {
				continue
			}
			out := PointerMap(in)
			assertValues(t, in, out, wantsPointer, idx)

			out2 := ValueMap(out)
			assertValues(t, in, out2, wantsValue, idx)
		}
	})

	t.Run("with ValueMap on map[string]bool", func(t *testing.T) {
		testCasesBoolMap := []map[string]bool{
			{"a": true, "b": false, "c": true},
		}

		for idx, in := range testCasesBoolMap {
			if in == nil {
				continue
			}
			out := PointerMap(in)
			assertValues(t, in, out, wantsPointer, idx)

			out2 := ValueMap(out)
			assertValues(t, in, out2, wantsValue, idx)
		}
	})
}

func TestPointer(t *testing.T) {
	t.Run("with Pointer on string", func(t *testing.T) {
		testCasesString := []string{"a", "b", "c", "d", "e", ""}

		for idx, in := range testCasesString {
			out := Pointer(in)
			assertValues(t, in, out, wantsPointer, idx)

			out2 := Value(out)
			assertValues(t, in, out2, wantsValue, idx)
		}
		assert.Emptyf(t, Value[string](nil), "expected conversion from nil to return zero value")
	})

	t.Run("with Value on bool", func(t *testing.T) {
		testCasesBool := []bool{true, false}

		for idx, in := range testCasesBool {
			out := Pointer(in)
			assertValues(t, in, out, wantsPointer, idx)

			out2 := Value(out)
			assertValues(t, in, out2, wantsValue, idx)
		}
		assert.Zerof(t, Value[bool](nil), "expected conversion from nil to return zero value")
	})
}

func assertSingleValue(t *testing.T, inElem, elem reflect.Value, expectPointer bool, idx int) {
	require.EqualTf(t,
		expectPointer, (elem.Kind() == reflect.Ptr),
		"unexpected expectPointer=%t value type %T at idx %d", expectPointer, elem, idx,
	)

	if inElem.Kind() == reflect.Ptr && !inElem.IsNil() {
		inElem = reflect.Indirect(inElem)
	}

	if elem.Kind() == reflect.Ptr && !elem.IsNil() {
		elem = reflect.Indirect(elem)
	}

	require.TrueTf(t,
		(elem.Kind() == reflect.Ptr && elem.IsNil()) ||
			typeutils.IsZero(elem.Interface()) == (inElem.Kind() == reflect.Ptr && inElem.IsNil()) ||
			typeutils.IsZero(inElem.Interface()),
		"unexpected nil pointer at idx %d", idx,
	)

	if (elem.Kind() != reflect.Ptr || !elem.IsNil()) && !typeutils.IsZero(elem.Interface()) {
		require.IsTypef(t, inElem.Interface(), elem.Interface(),
			"expected in/out to match types at idx %d", idx,
		)
		assert.Equalf(t, inElem.Interface(), elem.Interface(),
			"unexpected value at idx %d: %v", idx, elem.Interface(),
		)
	}
}

// assertValues checks equivalent representation pointer vs values for single var, slices and maps
func assertValues(t *testing.T, in, out any, expectPointer bool, idx int) {
	vin := reflect.ValueOf(in)
	vout := reflect.ValueOf(out)

	switch vin.Kind() { //nolint:exhaustive
	case reflect.Slice, reflect.Map:
		require.EqualTf(t, vin.Kind(), vout.Kind(),
			"unexpected output type at idx %d", idx,
		)
		require.EqualTf(t, vin.Len(), vout.Len(),
			"unexpected len at idx %d", idx,
		)

		var elem, inElem reflect.Value
		for i := 0; i < vin.Len(); i++ {
			switch vin.Kind() { //nolint:exhaustive
			case reflect.Slice:
				elem = vout.Index(i)
				inElem = vin.Index(i)
			case reflect.Map:
				keys := vin.MapKeys()
				elem = vout.MapIndex(keys[i])
				inElem = vout.MapIndex(keys[i])
			default:
			}

			assertSingleValue(t, inElem, elem, expectPointer, idx)
		}

	default:
		inElem := vin
		elem := vout

		assertSingleValue(t, inElem, elem, expectPointer, idx)
	}
}


================================================
FILE: conv/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package conv exposes utilities to convert types.
//
// The Convert and Format families of functions are essentially a shorthand to [strconv] functions,
// using the decimal representation of numbers.
//
// Features:
//
//   - from string representation to value ("Convert*") and reciprocally ("Format*")
//   - from pointer to value ([Value]) and reciprocally ([Pointer])
//   - from slice of values to slice of pointers ([PointerSlice]) and reciprocally ([ValueSlice])
//   - from map of values to map of pointers ([PointerMap]) and reciprocally ([ValueMap])
package conv


================================================
FILE: conv/format.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

import (
	"strconv"
)

// FormatInteger turns an integer type into a string.
func FormatInteger[T Signed](value T) string {
	return strconv.FormatInt(int64(value), 10)
}

// FormatUinteger turns an unsigned integer type into a string.
func FormatUinteger[T Unsigned](value T) string {
	return strconv.FormatUint(uint64(value), 10)
}

// FormatFloat turns a floating point numerical value into a string.
func FormatFloat[T Float](value T) string {
	return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value))
}

// FormatBool turns a boolean into a string.
func FormatBool(value bool) string {
	return strconv.FormatBool(value)
}


================================================
FILE: conv/go.mod
================================================
module github.com/go-openapi/swag/conv

require (
	github.com/go-openapi/swag/typeutils v0.26.0
	github.com/go-openapi/testify/v2 v2.5.0
)

replace github.com/go-openapi/swag/typeutils => ../typeutils

go 1.25.0


================================================
FILE: conv/go.sum
================================================
github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=
github.com/go-openapi/testify/v2 v2.5.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=


================================================
FILE: conv/sizeof.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

import "unsafe"

// bitsize returns the size in bits of a type.
//
// NOTE: [unsafe.SizeOf] simply returns the size in bytes of the value.
// For primitive types T, the generic stencil is precompiled and this value
// is resolved at compile time, resulting in an immediate call to [strconv.ParseFloat].
//
// We may leave up to the go compiler to simplify this function into a
// constant value, which happens in practice at least for primitive types
// (e.g. numerical types).
func bitsize[T Numerical](value T) int {
	const bitsPerByte = 8
	return int(unsafe.Sizeof(value)) * bitsPerByte
}


================================================
FILE: conv/type_constraints.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package conv

type (
	// these type constraints are redefined after golang.org/x/exp/constraints,
	// because importing that package causes an undesired go upgrade.

	// Signed integer types, cf. [golang.org/x/exp/constraints.Signed]
	Signed interface {
		~int | ~int8 | ~int16 | ~int32 | ~int64
	}

	// Unsigned integer types, cf. [golang.org/x/exp/constraints.Unsigned]
	Unsigned interface {
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
	}

	// Float numerical types, cf. [golang.org/x/exp/constraints.Float]
	Float interface {
		~float32 | ~float64
	}

	// Numerical types
	Numerical interface {
		Signed | Unsigned | Float
	}
)


================================================
FILE: conv_iface.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import (
	"time"

	"github.com/go-openapi/swag/conv"
)

// IsFloat64AJSONInteger allows for integers [-2^53, 2^53-1] inclusive.
//
// Deprecated: use [conv.IsFloat64AJSONInteger] instead.
func IsFloat64AJSONInteger(f float64) bool { return conv.IsFloat64AJSONInteger(f) }

// ConvertBool turns a string into a boolean.
//
// Deprecated: use [conv.ConvertBool] instead.
func ConvertBool(str string) (bool, error) { return conv.ConvertBool(str) }

// ConvertFloat32 turns a string into a float32.
//
// Deprecated: use [conv.ConvertFloat32] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
func ConvertFloat32(str string) (float32, error) { return conv.ConvertFloat[float32](str) }

// ConvertFloat64 turns a string into a float64.
//
// Deprecated: use [conv.ConvertFloat64] instead. Alternatively, you may use the generic version [conv.ConvertFloat].
func ConvertFloat64(str string) (float64, error) { return conv.ConvertFloat[float64](str) }

// ConvertInt8 turns a string into an int8.
//
// Deprecated: use [conv.ConvertInt8] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
func ConvertInt8(str string) (int8, error) { return conv.ConvertInteger[int8](str) }

// ConvertInt16 turns a string into an int16.
//
// Deprecated: use [conv.ConvertInt16] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
func ConvertInt16(str string) (int16, error) { return conv.ConvertInteger[int16](str) }

// ConvertInt32 turns a string into an int32.
//
// Deprecated: use [conv.ConvertInt32] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
func ConvertInt32(str string) (int32, error) { return conv.ConvertInteger[int32](str) }

// ConvertInt64 turns a string into an int64.
//
// Deprecated: use [conv.ConvertInt64] instead. Alternatively, you may use the generic version [conv.ConvertInteger].
func ConvertInt64(str string) (int64, error) { return conv.ConvertInteger[int64](str) }

// ConvertUint8 turns a string into an uint8.
//
// Deprecated: use [conv.ConvertUint8] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
func ConvertUint8(str string) (uint8, error) { return conv.ConvertUinteger[uint8](str) }

// ConvertUint16 turns a string into an uint16.
//
// Deprecated: use [conv.ConvertUint16] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
func ConvertUint16(str string) (uint16, error) { return conv.ConvertUinteger[uint16](str) }

// ConvertUint32 turns a string into an uint32.
//
// Deprecated: use [conv.ConvertUint32] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
func ConvertUint32(str string) (uint32, error) { return conv.ConvertUinteger[uint32](str) }

// ConvertUint64 turns a string into an uint64.
//
// Deprecated: use [conv.ConvertUint64] instead. Alternatively, you may use the generic version [conv.ConvertUinteger].
func ConvertUint64(str string) (uint64, error) { return conv.ConvertUinteger[uint64](str) }

// FormatBool turns a boolean into a string.
//
// Deprecated: use [conv.FormatBool] instead.
func FormatBool(value bool) string { return conv.FormatBool(value) }

// FormatFloat32 turns a float32 into a string.
//
// Deprecated: use [conv.FormatFloat] instead.
func FormatFloat32(value float32) string { return conv.FormatFloat(value) }

// FormatFloat64 turns a float64 into a string.
//
// Deprecated: use [conv.FormatFloat] instead.
func FormatFloat64(value float64) string { return conv.FormatFloat(value) }

// FormatInt8 turns an int8 into a string.
//
// Deprecated: use [conv.FormatInteger] instead.
func FormatInt8(value int8) string { return conv.FormatInteger(value) }

// FormatInt16 turns an int16 into a string.
//
// Deprecated: use [conv.FormatInteger] instead.
func FormatInt16(value int16) string { return conv.FormatInteger(value) }

// FormatInt32 turns an int32 into a string
//
// Deprecated: use [conv.FormatInteger] instead.
func FormatInt32(value int32) string { return conv.FormatInteger(value) }

// FormatInt64 turns an int64 into a string.
//
// Deprecated: use [conv.FormatInteger] instead.
func FormatInt64(value int64) string { return conv.FormatInteger(value) }

// FormatUint8 turns an uint8 into a string.
//
// Deprecated: use [conv.FormatUinteger] instead.
func FormatUint8(value uint8) string { return conv.FormatUinteger(value) }

// FormatUint16 turns an uint16 into a string.
//
// Deprecated: use [conv.FormatUinteger] instead.
func FormatUint16(value uint16) string { return conv.FormatUinteger(value) }

// FormatUint32 turns an uint32 into a string.
//
// Deprecated: use [conv.FormatUinteger] instead.
func FormatUint32(value uint32) string { return conv.FormatUinteger(value) }

// FormatUint64 turns an uint64 into a string.
//
// Deprecated: use [conv.FormatUinteger] instead.
func FormatUint64(value uint64) string { return conv.FormatUinteger(value) }

// String turn a pointer to of the string value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func String(v string) *string { return conv.Pointer(v) }

// StringValue turn the value of the string pointer passed in or
// "" if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func StringValue(v *string) string { return conv.Value(v) }

// StringSlice converts a slice of string values into a slice of string pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func StringSlice(src []string) []*string { return conv.PointerSlice(src) }

// StringValueSlice converts a slice of string pointers into a slice of string values.
//
// Deprecated: use [conv.ValueSlice] instead.
func StringValueSlice(src []*string) []string { return conv.ValueSlice(src) }

// StringMap converts a string map of string values into a string map of string pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func StringMap(src map[string]string) map[string]*string { return conv.PointerMap(src) }

// StringValueMap converts a string map of string pointers into a string map of string values.
//
// Deprecated: use [conv.ValueMap] instead.
func StringValueMap(src map[string]*string) map[string]string { return conv.ValueMap(src) }

// Bool turn a pointer to of the bool value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Bool(v bool) *bool { return conv.Pointer(v) }

// BoolValue turn the value of the bool pointer passed in or false if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func BoolValue(v *bool) bool { return conv.Value(v) }

// BoolSlice converts a slice of bool values into a slice of bool pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func BoolSlice(src []bool) []*bool { return conv.PointerSlice(src) }

// BoolValueSlice converts a slice of bool pointers into a slice of bool values.
//
// Deprecated: use [conv.ValueSlice] instead.
func BoolValueSlice(src []*bool) []bool { return conv.ValueSlice(src) }

// BoolMap converts a string map of bool values into a string map of bool pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func BoolMap(src map[string]bool) map[string]*bool { return conv.PointerMap(src) }

// BoolValueMap converts a string map of bool pointers into a string map of bool values.
//
// Deprecated: use [conv.ValueMap] instead.
func BoolValueMap(src map[string]*bool) map[string]bool { return conv.ValueMap(src) }

// Int turn a pointer to of the int value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Int(v int) *int { return conv.Pointer(v) }

// IntValue turn the value of the int pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func IntValue(v *int) int { return conv.Value(v) }

// IntSlice converts a slice of int values into a slice of int pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func IntSlice(src []int) []*int { return conv.PointerSlice(src) }

// IntValueSlice converts a slice of int pointers into a slice of int values.
//
// Deprecated: use [conv.ValueSlice] instead.
func IntValueSlice(src []*int) []int { return conv.ValueSlice(src) }

// IntMap converts a string map of int values into a string map of int pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func IntMap(src map[string]int) map[string]*int { return conv.PointerMap(src) }

// IntValueMap converts a string map of int pointers into a string map of int values.
//
// Deprecated: use [conv.ValueMap] instead.
func IntValueMap(src map[string]*int) map[string]int { return conv.ValueMap(src) }

// Int32 turn a pointer to of the int32 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Int32(v int32) *int32 { return conv.Pointer(v) }

// Int32Value turn the value of the int32 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Int32Value(v *int32) int32 { return conv.Value(v) }

// Int32Slice converts a slice of int32 values into a slice of int32 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Int32Slice(src []int32) []*int32 { return conv.PointerSlice(src) }

// Int32ValueSlice converts a slice of int32 pointers into a slice of int32 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Int32ValueSlice(src []*int32) []int32 { return conv.ValueSlice(src) }

// Int32Map converts a string map of int32 values into a string map of int32 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Int32Map(src map[string]int32) map[string]*int32 { return conv.PointerMap(src) }

// Int32ValueMap converts a string map of int32 pointers into a string map of int32 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Int32ValueMap(src map[string]*int32) map[string]int32 { return conv.ValueMap(src) }

// Int64 turn a pointer to of the int64 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Int64(v int64) *int64 { return conv.Pointer(v) }

// Int64Value turn the value of the int64 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Int64Value(v *int64) int64 { return conv.Value(v) }

// Int64Slice converts a slice of int64 values into a slice of int64 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Int64Slice(src []int64) []*int64 { return conv.PointerSlice(src) }

// Int64ValueSlice converts a slice of int64 pointers into a slice of int64 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Int64ValueSlice(src []*int64) []int64 { return conv.ValueSlice(src) }

// Int64Map converts a string map of int64 values into a string map of int64 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Int64Map(src map[string]int64) map[string]*int64 { return conv.PointerMap(src) }

// Int64ValueMap converts a string map of int64 pointers into a string map of int64 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Int64ValueMap(src map[string]*int64) map[string]int64 { return conv.ValueMap(src) }

// Uint16 turn a pointer to of the uint16 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Uint16(v uint16) *uint16 { return conv.Pointer(v) }

// Uint16Value turn the value of the uint16 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Uint16Value(v *uint16) uint16 { return conv.Value(v) }

// Uint16Slice converts a slice of uint16 values into a slice of uint16 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Uint16Slice(src []uint16) []*uint16 { return conv.PointerSlice(src) }

// Uint16ValueSlice converts a slice of uint16 pointers into a slice of uint16 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Uint16ValueSlice(src []*uint16) []uint16 { return conv.ValueSlice(src) }

// Uint16Map converts a string map of uint16 values into a string map of uint16 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Uint16Map(src map[string]uint16) map[string]*uint16 { return conv.PointerMap(src) }

// Uint16ValueMap converts a string map of uint16 pointers into a string map of uint16 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { return conv.ValueMap(src) }

// Uint turn a pointer to of the uint value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Uint(v uint) *uint { return conv.Pointer(v) }

// UintValue turn the value of the uint pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func UintValue(v *uint) uint { return conv.Value(v) }

// UintSlice converts a slice of uint values into a slice of uint pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func UintSlice(src []uint) []*uint { return conv.PointerSlice(src) }

// UintValueSlice converts a slice of uint pointers into a slice of uint values.
//
// Deprecated: use [conv.ValueSlice] instead.
func UintValueSlice(src []*uint) []uint { return conv.ValueSlice(src) }

// UintMap converts a string map of uint values into a string map of uint pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func UintMap(src map[string]uint) map[string]*uint { return conv.PointerMap(src) }

// UintValueMap converts a string map of uint pointers into a string map of uint values.
//
// Deprecated: use [conv.ValueMap] instead.
func UintValueMap(src map[string]*uint) map[string]uint { return conv.ValueMap(src) }

// Uint32 turn a pointer to of the uint32 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Uint32(v uint32) *uint32 { return conv.Pointer(v) }

// Uint32Value turn the value of the uint32 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Uint32Value(v *uint32) uint32 { return conv.Value(v) }

// Uint32Slice converts a slice of uint32 values into a slice of uint32 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Uint32Slice(src []uint32) []*uint32 { return conv.PointerSlice(src) }

// Uint32ValueSlice converts a slice of uint32 pointers into a slice of uint32 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Uint32ValueSlice(src []*uint32) []uint32 { return conv.ValueSlice(src) }

// Uint32Map converts a string map of uint32 values into a string map of uint32 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Uint32Map(src map[string]uint32) map[string]*uint32 { return conv.PointerMap(src) }

// Uint32ValueMap converts a string map of uint32 pointers into a string map of uint32 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return conv.ValueMap(src) }

// Uint64 turn a pointer to of the uint64 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Uint64(v uint64) *uint64 { return conv.Pointer(v) }

// Uint64Value turn the value of the uint64 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Uint64Value(v *uint64) uint64 { return conv.Value(v) }

// Uint64Slice converts a slice of uint64 values into a slice of uint64 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Uint64Slice(src []uint64) []*uint64 { return conv.PointerSlice(src) }

// Uint64ValueSlice converts a slice of uint64 pointers into a slice of uint64 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Uint64ValueSlice(src []*uint64) []uint64 { return conv.ValueSlice(src) }

// Uint64Map converts a string map of uint64 values into a string map of uint64 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Uint64Map(src map[string]uint64) map[string]*uint64 { return conv.PointerMap(src) }

// Uint64ValueMap converts a string map of uint64 pointers into a string map of uint64 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return conv.ValueMap(src) }

// Float32 turn a pointer to of the float32 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Float32(v float32) *float32 { return conv.Pointer(v) }

// Float32Value turn the value of the float32 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Float32Value(v *float32) float32 { return conv.Value(v) }

// Float32Slice converts a slice of float32 values into a slice of float32 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Float32Slice(src []float32) []*float32 { return conv.PointerSlice(src) }

// Float32ValueSlice converts a slice of float32 pointers into a slice of float32 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Float32ValueSlice(src []*float32) []float32 { return conv.ValueSlice(src) }

// Float32Map converts a string map of float32 values into a string map of float32 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Float32Map(src map[string]float32) map[string]*float32 { return conv.PointerMap(src) }

// Float32ValueMap converts a string map of float32 pointers into a string map of float32 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Float32ValueMap(src map[string]*float32) map[string]float32 { return conv.ValueMap(src) }

// Float64 turn a pointer to of the float64 value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Float64(v float64) *float64 { return conv.Pointer(v) }

// Float64Value turn the value of the float64 pointer passed in or 0 if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func Float64Value(v *float64) float64 { return conv.Value(v) }

// Float64Slice converts a slice of float64 values into a slice of float64 pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func Float64Slice(src []float64) []*float64 { return conv.PointerSlice(src) }

// Float64ValueSlice converts a slice of float64 pointers into a slice of float64 values.
//
// Deprecated: use [conv.ValueSlice] instead.
func Float64ValueSlice(src []*float64) []float64 { return conv.ValueSlice(src) }

// Float64Map converts a string map of float64 values into a string map of float64 pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func Float64Map(src map[string]float64) map[string]*float64 { return conv.PointerMap(src) }

// Float64ValueMap converts a string map of float64 pointers into a string map of float64 values.
//
// Deprecated: use [conv.ValueMap] instead.
func Float64ValueMap(src map[string]*float64) map[string]float64 { return conv.ValueMap(src) }

// Time turn a pointer to of the time.Time value passed in.
//
// Deprecated: use [conv.Pointer] instead.
func Time(v time.Time) *time.Time { return conv.Pointer(v) }

// TimeValue turn the value of the time.Time pointer passed in or time.Time{} if the pointer is nil.
//
// Deprecated: use [conv.Value] instead.
func TimeValue(v *time.Time) time.Time { return conv.Value(v) }

// TimeSlice converts a slice of time.Time values into a slice of time.Time pointers.
//
// Deprecated: use [conv.PointerSlice] instead.
func TimeSlice(src []time.Time) []*time.Time { return conv.PointerSlice(src) }

// TimeValueSlice converts a slice of time.Time pointers into a slice of time.Time values
//
// Deprecated: use [conv.ValueSlice] instead.
func TimeValueSlice(src []*time.Time) []time.Time { return conv.ValueSlice(src) }

// TimeMap converts a string map of time.Time values into a string map of time.Time pointers.
//
// Deprecated: use [conv.PointerMap] instead.
func TimeMap(src map[string]time.Time) map[string]*time.Time { return conv.PointerMap(src) }

// TimeValueMap converts a string map of time.Time pointers into a string map of time.Time values.
//
// Deprecated: use [conv.ValueMap] instead.
func TimeValueMap(src map[string]*time.Time) map[string]time.Time { return conv.ValueMap(src) }


================================================
FILE: conv_iface_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import (
	"testing"
	"time"

	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

func TestConvIface(t *testing.T) {
	const epsilon = 1e-6

	t.Run("deprecated Convert functions should work", func(t *testing.T) {
		// only check happy path - more comprehensive testing is carried out inside the called package
		assert.TrueT(t, IsFloat64AJSONInteger(1.00))

		b, err := ConvertBool("true")
		require.NoError(t, err)
		assert.TrueT(t, b)

		f32, err := ConvertFloat32("1.05")
		require.NoError(t, err)
		assert.InDeltaT(t, float32(1.05), f32, epsilon)

		f64, err := ConvertFloat64("1.05")
		require.NoError(t, err)
		assert.InDelta(t, float32(1.05), f64, epsilon)

		i8, err := ConvertInt8("2")
		require.NoError(t, err)
		assert.EqualT(t, int8(2), i8)

		i16, err := ConvertInt16("2")
		require.NoError(t, err)
		assert.EqualT(t, int16(2), i16)

		i32, err := ConvertInt32("2")
		require.NoError(t, err)
		assert.EqualT(t, int32(2), i32)

		i64, err := ConvertInt64("2")
		require.NoError(t, err)
		assert.EqualT(t, int64(2), i64)

		u8, err := ConvertUint8("2")
		require.NoError(t, err)
		assert.EqualT(t, uint8(2), u8)

		u16, err := ConvertUint16("2")
		require.NoError(t, err)
		assert.EqualT(t, uint16(2), u16)

		u32, err := ConvertUint32("2")
		require.NoError(t, err)
		assert.EqualT(t, uint32(2), u32)

		u64, err := ConvertUint64("2")
		require.NoError(t, err)
		assert.EqualT(t, uint64(2), u64)
	})

	t.Run("deprecated Format functions should work", func(t *testing.T) {
		assert.EqualT(t, "true", FormatBool(true))
		assert.EqualT(t, "1.05", FormatFloat32(1.05))
		assert.EqualT(t, "1.05", FormatFloat64(1.05))
		assert.EqualT(t, "1", FormatInt8(1))
		assert.EqualT(t, "1", FormatInt16(1))
		assert.EqualT(t, "1", FormatInt32(1))
		assert.EqualT(t, "1", FormatInt64(1))
		assert.EqualT(t, "1", FormatUint8(1))
		assert.EqualT(t, "1", FormatUint16(1))
		assert.EqualT(t, "1", FormatUint32(1))
		assert.EqualT(t, "1", FormatUint64(1))
	})

	t.Run("deprecated pointer functions should work", func(t *testing.T) {
		assert.EqualT(t, "a", StringValue(String("a")))
		assert.Equal(t, []string{"a"}, StringValueSlice(StringSlice([]string{"a"})))
		assert.Equal(t, map[string]string{"1": "a"}, StringValueMap(StringMap(map[string]string{"1": "a"})))

		assert.TrueT(t, BoolValue(Bool(true)))
		assert.Equal(t, []bool{true}, BoolValueSlice(BoolSlice([]bool{true})))
		assert.Equal(t, map[string]bool{"1": true}, BoolValueMap(BoolMap(map[string]bool{"1": true})))

		assert.EqualT(t, 1, IntValue(Int(1)))
		assert.Equal(t, []int{1}, IntValueSlice(IntSlice([]int{1})))
		assert.Equal(t, map[string]int{"1": 1}, IntValueMap(IntMap(map[string]int{"1": 1})))

		assert.EqualT(t, int32(1), Int32Value(Int32(1)))
		assert.Equal(t, []int32{1}, Int32ValueSlice(Int32Slice([]int32{1})))
		assert.Equal(t, map[string]int32{"1": 1}, Int32ValueMap(Int32Map(map[string]int32{"1": 1})))

		assert.EqualT(t, int64(1), Int64Value(Int64(1)))
		assert.Equal(t, []int64{1}, Int64ValueSlice(Int64Slice([]int64{1})))
		assert.Equal(t, map[string]int64{"1": 1}, Int64ValueMap(Int64Map(map[string]int64{"1": 1})))

		assert.EqualT(t, uint16(1), Uint16Value(Uint16(1)))
		assert.Equal(t, []uint16{1}, Uint16ValueSlice(Uint16Slice([]uint16{1})))
		assert.Equal(t, map[string]uint16{"1": 1}, Uint16ValueMap(Uint16Map(map[string]uint16{"1": 1})))

		assert.EqualT(t, uint32(1), Uint32Value(Uint32(1)))
		assert.Equal(t, []uint32{1}, Uint32ValueSlice(Uint32Slice([]uint32{1})))
		assert.Equal(t, map[string]uint32{"1": 1}, Uint32ValueMap(Uint32Map(map[string]uint32{"1": 1})))

		assert.EqualT(t, uint64(1), Uint64Value(Uint64(1)))
		assert.Equal(t, []uint64{1}, Uint64ValueSlice(Uint64Slice([]uint64{1})))
		assert.Equal(t, map[string]uint64{"1": 1}, Uint64ValueMap(Uint64Map(map[string]uint64{"1": 1})))

		assert.EqualT(t, uint(1), UintValue(Uint(1)))
		assert.Equal(t, []uint{1}, UintValueSlice(UintSlice([]uint{1})))
		assert.Equal(t, map[string]uint{"1": 1}, UintValueMap(UintMap(map[string]uint{"1": 1})))

		assert.InDeltaT(t, float32(1.00), Float32Value(Float32(1.00)), epsilon)
		assert.Equal(t, []float32{1.00}, Float32ValueSlice(Float32Slice([]float32{1.00})))
		assert.Equal(t, map[string]float32{"1": 1.00}, Float32ValueMap(Float32Map(map[string]float32{"1": 1.00})))

		assert.InDeltaT(t, float64(1.00), Float64Value(Float64(1)), epsilon)
		assert.Equal(t, []float64{1.00}, Float64ValueSlice(Float64Slice([]float64{1.00})))
		assert.Equal(t, map[string]float64{"1": 1.00}, Float64ValueMap(Float64Map(map[string]float64{"1": 1.00})))

		assert.Equal(t, time.Unix(0, 0), TimeValue(Time(time.Unix(0, 0))))
		assert.Equal(t, []time.Time{time.Unix(0, 0)}, TimeValueSlice(TimeSlice([]time.Time{time.Unix(0, 0)})))
		assert.Equal(t, map[string]time.Time{"1": time.Unix(0, 0)}, TimeValueMap(TimeMap(map[string]time.Time{"1": time.Unix(0, 0)})))
	})
}


================================================
FILE: doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package swag contains a bunch of helper functions for go-openapi and go-swagger projects.
//
// You may also use it standalone for your projects.
//
// NOTE: all features that used to be exposed as package-level members (constants, variables,
// functions and types) are now deprecated and are superseded by equivalent features in
// more specialized sub-packages.
// Moving forward, no additional feature will be added to the [swag] API directly at the root package level,
// which remains there for backward-compatibility purposes.
//
// Child modules will continue to evolve or some new ones may be added in the future.
//
// # Modules
//
//   - [cmdutils]      utilities to work with CLIs
//
//   - [conv]          type conversion utilities
//
//   - [fileutils]     file utilities
//
//   - [jsonname]      JSON utilities
//
//   - [jsonutils]     JSON utilities
//
//   - [loading]       file loading
//
//   - [mangling]      safe name generation
//
//   - [netutils]      networking utilities
//
//   - [stringutils]   `string` utilities
//
//   - [typeutils]     `go` types utilities
//
//   - [yamlutils]     YAML utilities
//
// # Dependencies
//
// This repo has a few dependencies outside of the standard library:
//
//   - YAML utilities depend on [go.yaml.in/yaml/v3]
package swag

//go:generate mockery


================================================
FILE: docs/MAINTAINERS.md
================================================
> [!NOTE]
> Comprehensive guide for maintainers covering repository structure, CI/CD workflows, release procedures, and development practices.
> Essential reading for anyone contributing to or maintaining this project.

## Repo structure

This project is organized as a monorepo with multiple go modules.

## Repo configuration

* Default branch: master
* Protected branches: master
* Branch protection rules:
  * require pull requests and approval
  * required status checks:
    * DCO (simple email sign-off)
    * Lint
    * All tests completed
* Auto-merge enabled (used for dependabot updates and other auto-merged PR's, e.g. contributors update)

## Continuous Integration

### Code Quality checks

* meta-linter: [golangci-lint][golangci-url]
* linter config: [`.golangci.yml`][linter-config] (see our [posture][style-doc] on linters)
* Code quality assessment: [CodeFactor][codefactor-url]
* Code quality badges
  * [go report card][gocard-url]
  * [CodeFactor][codefactor-url]

> **NOTES**
>
> codefactor inherits roles from github. There is no need to create a dedicated account.
>
> The codefactor app is installed at the organization level (`github.com/go-openapi`).
>
> There is no special token to setup in github for CI usage.

### Testing

* Test reports
  * Uploaded to codecov: <https://app.codecov.io/analytics/gh/go-openapi>
* Test coverage reports
  * Uploaded to codecov: <https://app.codecov.io/gh/go-openapi>

* Fuzz testing
  * Fuzz tests are handled separately by CI and may reuse a cached version of the fuzzing corpus.
    At this moment, cache may not be shared between feature branches or feature branch and master.
    The minimized corpus produced on failure is uploaded as an artifact and should be added manually
    to `testdata/fuzz/...`.

Coverage threshold status is informative and not blocking.
This is because the thresholds are difficult to tune and codecov oftentimes reports false negatives
or may fail to upload coverage.

All tests across `go-openapi` use our fork of `stretchr/swag` (this repo): `github.com/go-openapi/swag`.
This allows for minimal test dependencies.

> **NOTES**
>
> codecov inherits roles from github. There is no need to create a dedicated account.
> However, there is only 1 maintainer allowed to be the admin of the organization on codecov
> with their free plan.
>
> The codecov app is installed at the organization level (`github.com/go-openapi`).
>
> There is no special token to setup in github for CI usage.
> A organization-level token used to upload coverage and test reports is managed at codecov:
> no setup is required on github.

### Automated updates

* dependabot
  * configuration: [`dependabot.yaml`][dependabot-config]

  Principle:

  * codecov applies updates and security patches to the github-actions and golang ecosystems.
  * all updates from "trusted" dependencies (github actions, golang.org packages, go-openapi packages
    are auto-merged if they successfully pass CI.

* go version updates

  Principle:

  * we support the 2 latest minor versions of the go compiler (`stable`, `oldstable`)
  * `go.mod` should be updated (manually) whenever there is a new go minor release
    (e.g. every 6 months).

  > This means that our projects always have a 6 months lag to enforce new features from the go compiler.
  >
  > However, new features of go may be used with a "go:build" tag: this allows users of the newer
  > version to benefit the new feature while users still running with `oldstable` use another version
  > that still builds.

* contributors
  * a [`CONTRIBUTORS.md`][contributors-doc] file is updated weekly, with all-time contributors to the repository
  * the `github-actions[bot]` posts a pull request to do that automatically
  * at this moment, this pull request is not auto-approved/auto-merged (bot cannot approve its own PRs)

### Vulnerability scanners

There are 3 complementary scanners - obviously, there is some overlap, but each has a different focus.

* GitHub `CodeQL` <https://github.com/github/codeql>
* `trivy` <https://trivy.dev/docs/latest/getting-started>
* `govulnscan` <https://go.dev/blog/govulncheck>

None of these tools require an additional account or token.

Github CodeQL configuration is set to "Advanced", so we may collect a CI status for this check (e.g. for badges).

Scanners run on every commit to master and at least once a week.

Reports are centralized in github security reports for code scanning tools.

## Releases

**For single module repos:**

A bump release workflow can be triggered from the github actions UI to cut a release with a few clicks.

The release process is minimalist:

* push a semver tag (i.e v{major}.{minor}.{patch}) to the master branch.
* the CI handles this to generate a github release with release notes

* release notes generator: git-cliff <https://git-cliff.org/docs/>
* configuration: the `.cliff.toml` is defined as a share configuration on
  remote repo [`ci-workflows/.cliff.toml`][remote-cliff-config]

Commits from maintainers are preferably PGP-signed.

Tags are preferably PGP-signed.

We want our releases to show as "verified" on github.

The tag message introduces the release notes (e.g. a summary of this release).

The release notes generator does not assume that commits are necessarily "conventional commits".

**For mono-repos with multiple modules:**

The release process is slightly different because we need to update cross-module dependencies
before pushing a tag.

A bump release workflow (mono-repo) can be triggered from the github actions UI to cut a release with a few clicks.

It works with the same input as the one for single module repos, and first creates a PR (auto-merged)
that updates the different go.mod files _before_ pushing the desired git tag.

Commits and tags pushed by the workflow bot are PGP-signed ("go-openapi[bot]").

## Other files

Standard documentation:

* [CONTRIBUTING.md][contributing-doc] guidelines
* [DCO.md][dco-doc] terms for first-time contributors to read
* [CODE_OF_CONDUCT.md][coc-doc]
* [SECURITY.md][security-doc] policy: how to report vulnerabilities privately
* [LICENSE][license-doc] terms
<!-- * [NOTICE][notice-doc] on supplementary license terms (original authors, copied code etc) -->

Reference documentation (released):

* [pkg.go.dev (fka godoc)][godoc-url]

<!-- links to references -->
[linter-config]: https://github.com/go-openapi/swag/blob/master/.golangci.yml
[local-cliff-config]: https://github.com/go-openapi/swag/blob/master/.cliff.toml
[remote-cliff-config]: https://github.com/go-openapi/ci-workflows/blob/master/.cliff.toml
[dependabot-config]: https://github.com/go-openapi/swag/blob/master/.github/dependabot.yaml
[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/swag
[codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/swag
[golangci-url]: https://golangci-lint.run/
[godoc-url]: https://pkg.go.dev/github.com/go-openapi/swag
[contributors-doc]: ../CONTRIBUTORS.md
[contributing-doc]: ../.github/CONTRIBUTING.md
[dco-doc]: ../.github/DCO.md
[style-doc]: STYLE.md
[coc-doc]: ../CODE_OF_CONDUCT.md
[security-doc]: ../SECURITY.md
[license-doc]: ../LICENSE
[notice-doc]: ../NOTICE


================================================
FILE: docs/NOTES.md
================================================
# pre-v0.26.0 release notes

## v0.25.4

**mangling**

Bug fix

* [x] mangler may panic with pluralized overlapping initialisms

Tests

* [x] introduced fuzz tests

## v0.25.3

**mangling**

Bug fix

* [x] mangler may panic with pluralized initialisms

## v0.25.2

Minor changes due to internal maintenance that don't affect the behavior of the library.

* [x] removed indirect test dependencies by switching all tests to `go-openapi/testify`,
  a fork of `stretch/testify` with zero-dependencies.
* [x] improvements to CI to catch test reports.
* [x] modernized licensing annotations in source code, using the more compact SPDX annotations
  rather than the full license terms.
* [x] simplified a bit JSON & YAML testing by using newly available assertions
* started the journey to an OpenSSF score card badge:
  * [x] explicated permissions in CI workflows
  * [x] published security policy
  * pinned dependencies to github actions
  * introduced fuzzing in tests

## v0.25.1

* fixes a data race that could occur when using the standard library implementation of a JSON ordered map

## v0.25.0

**New with this release**:

* requires `go1.24`, as iterators are being introduced
* removes the dependency to `mailru/easyjson` by default (#68)
  * functionality remains the same, but performance may somewhat degrade for applications
    that relied on `easyjson`
  * users of the JSON or YAML utilities who want to use `easyjson` as their preferred JSON serializer library
    will be able to do so by registering this the corresponding JSON adapter at runtime. See below.
  * ordered keys in JSON and YAML objects: this feature used to rely solely on `easyjson`.
    With this release, an implementation relying on the standard `encoding/json` is provided.
  * an independent [benchmark](../jsonutils/adapters/testintegration/benchmarks/README.md) to compare the different adapters
* improves the "float is integer" check (`conv.IsFloat64AJSONInteger`) (#59)
* removes the _direct_ dependency to `gopkg.in/yaml.v3` (indirect dependency is still incurred through `stretchr/testify`) (#127)
* exposed `conv.IsNil()` (previously kept private): a safe nil check (accounting for the "non-nil interface with nil value" nonsensical go trick)

## v0.24.0

With this release, we have largely modernized the API of `swag`:

* The traditional `swag` API is still supported: code that imports `swag` will still
  compile and work the same.
* A deprecation notice is published to encourage consumers of this library to adopt
  the newer API
* **Deprecation notice**
  * configuration through global variables is now deprecated, in favor of options passed as parameters
  * all helper functions are moved to more specialized packages, which are exposed as
    go modules. Importing such a module would reduce the footprint of dependencies.
  * _all_ functions, variables, constants exposed by the deprecated API have now moved, so
    that consumers of the new API no longer need to import github.com/go-openapi/swag, but
    should import the desired sub-module(s).

**New with this release**:

* [x] type converters and pointer to value helpers now support generic types
* [x] name mangling now support pluralized initialisms (issue #46)
      Strings like "contact IDs" are now recognized as such a plural form and mangled as a linter would expect.
* [x] performance: small improvements to reduce the overhead of convert/format wrappers (see issues #110, or PR #108)
* [x] performance: name mangling utilities run ~ 10% faster (PR #115)


================================================
FILE: docs/STYLE.md
================================================
# Coding style at `go-openapi`

> **TL;DR**
>
> Let's be honest: at `go-openapi` and `go-swagger` we've never been super-strict on code style and linting.
>
> But perhaps now (2025) is the time to adopt a different stance.

Even though our repos have been early adopters of `golangci-lint` years ago
(we used some other metalinter before), our decade-old codebase is only realigned to new rules from time to time.

Now go-openapi and go-swagger together make up a really large codebase, which is taxing to maintain and keep afloat.

Code quality and the harmonization of rules have thus become things that we need now.

## Meta-linter

Universally formatted go code promotes ease of writing, reading, and maintenance.

You should run `golangci-lint run` before committing your changes.

Many editors have plugins that do that automatically.

> We use the `golangci-lint` meta-linter. The configuration lies in
> [`.golangci.yml`][golangci-yml].
> You may read [the linter's configuration reference][golangci-doc] for additional reference.

This configuration is essentially the same across all `go-openapi` projects.

Some projects may require slightly different settings.

## Linting rules posture

Thanks to go's original design, we developers don't have to waste much time arguing about code figures of style.

However, the number of available linters has been growing to the point that we need to pick a choice.

### Our approach: evaluate, don't consume blindly

As early adopters of `golangci-lint` (and its predecessors), we've watched linting orthodoxy
shift back and forth over the years. Patterns that were idiomatic one year get flagged the next;
rules that seemed reasonable in isolation produce noise at scale. Conversations with maintainers
of other large Go projects confirmed what our own experience taught us:
**the default linter set is a starting point, not a prescription**.

Our stance is deliberate:

- **Start from `default: all`**, then consciously disable what doesn't earn its keep.
  This forces us to evaluate every linter and articulate why we reject it — the disabled list
  is a design rationale, not technical debt.
- **Tune thresholds rather than disable** when a linter's principle is sound but its defaults
  are too aggressive for a mature codebase.
- **Require justification for every `//nolint`** directive. Each one must carry an inline comment
  explaining why it's there.
- **Prefer disabling a linter over scattering `//nolint`** across the codebase. If a linter
  produces systematic false positives on patterns we use intentionally, the linter goes —
  not our code.
- **Keep the configuration consistent** across all `go-openapi` repositories. Per-repo
  divergence is a maintenance tax we don't want to pay.

We enable all linters published by `golangci-lint` by default, then disable a few ones.

Here are the reasons why they are disabled (update: Feb. 2026, `golangci-lint v2.8.0`).

```yaml
  disable:
    - depguard              # we don't want to configure rules to constrain import. That's the reviewer's job
    - exhaustruct           # we don't want to configure regexp's to check type name. That's the reviewer's job
    - funlen                # we accept cognitive complexity as a meaningful metric, but function length is relevant
    - godox                 # we don't see any value in forbidding TODO's etc in code
    - nlreturn              # we usually apply this "blank line" rule to make code less compact. We just don't want to enforce it
    - nonamedreturns        # we don't see any valid reason why we couldn't used named returns
    - noinlineerr           # there is no value added forbidding inlined err
    - paralleltest          # we like parallel tests. We just don't want them to be enforced everywhere
    - recvcheck             # we like the idea of having pointer and non-pointer receivers
    - testpackage           # we like test packages. We just don't want them to be enforced everywhere
    - thelper               # too many false positives on test case factories returning func(*testing.T). See note below
    - tparallel             # see paralleltest
    - varnamelen            # sometimes, we like short variables. The linter doesn't catch cases when a short name is good
    - whitespace            # no added value
    - wrapcheck             # although there is some sense with this linter's general idea, it produces too much noise
    - wsl                   # no added value. Noise
    - wsl_v5                # no added value. Noise
```

As you may see, we agree with the objective of most linters, at least the principle they are supposed to enforce.
But all linters do not support fine-grained tuning to tolerate some cases and not some others.

**Relaxed linter settings**

When this is possible, we enable linters with relaxed constraints.

```yaml
  settings:
    dupl:
      threshold: 200        # in a older code base such as ours, we have to be tolerant with a little redundancy
                            # Hopefully, we'll be able to gradually get rid of those.
    goconst:
      min-len: 2
      min-occurrences: 3
    cyclop:
      max-complexity: 20    # the default is too low for most of our functions. 20 is a nicer trade-off
    gocyclo:
      min-complexity: 20
    exhaustive:             # when using default in switch, this should be good enough
      default-signifies-exhaustive: true
      default-case-required: true
    lll:
      line-length: 180      # we just want to avoid extremely long lines.
                            # It is no big deal if a line or two don't fit on your terminal.
```

Final note: since we have switched to a forked version of `stretchr/testify`,
we no longer benefit from the great `testifylint` linter for tests.

[golangci-yml]: https://github.com/go-openapi/swag/blob/master/.golangci.yml
[golangci-doc]: https://golangci-lint.run/docs/linters/configuration/


================================================
FILE: docs/TODOS.md
================================================
# Roadmap

A few ideas on the todo list:

* [x] Complete the split of dependencies to isolate easyjson from the rest
* [x] Improve CI to reduce needed tests
* [x] Replace dependency to `gopkg.in/yaml.v3` (`yamlutil`)
* [ ] Improve mangling utilities (improve readability, support for capitalized words,
      better word substitution for non-letter symbols...)
* [ ] Move back to this common shared pot a few of the technical features introduced by go-swagger independently
      (e.g. mangle go package names, search package with go modules support, ...)
* [ ] Apply a similar mono-repo approach to `go-openapi/strfmt` which suffer from similar woes: bloated API,
      imposed dependency to some database driver.
* [ ] Adapt `go-swagger` (incl. generated code) to the new `swag` API.
* [ ] Factorize some tests, as there is a lot of redundant testing code in `jsonutils`
* [ ] Benchmark & profiling: publish independently the tool built to analyze and chart benchmarks (e.g. similar to `benchvisual`)
* [ ] more thorough testing for nil / null case
* [ ] ci pipeline to manage releases
* [ ] cleaner mockery generation (doesn't work out of the box for all sub-modules)


================================================
FILE: fileutils/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package fileutils exposes utilities to deal with files and paths.
//
// Currently, there is:
//   - [File] to represent an abstraction of an uploaded file.
//     For instance, this is used by [github.com/go-openapi/runtime.File].
//   - path search utilities (e.g. finding packages in the GO search path)
package fileutils


================================================
FILE: fileutils/file.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package fileutils

import "mime/multipart"

// File represents an uploaded file.
type File struct {
	Data   multipart.File
	Header *multipart.FileHeader
}

// Read bytes from the file
func (f *File) Read(p []byte) (n int, err error) {
	return f.Data.Read(p)
}

// Close the file
func (f *File) Close() error {
	return f.Data.Close()
}


================================================
FILE: fileutils/file_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package fileutils

import (
	"io"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
)

func TestFileImplementsIOReader(t *testing.T) {
	var file any = &File{}
	expected := "that File implements io.Reader"
	assert.Implements(t, new(io.Reader), file, expected)
}

func TestFileImplementsIOReadCloser(t *testing.T) {
	var file any = &File{}
	expected := "that File implements io.ReadCloser"
	assert.Implements(t, new(io.ReadCloser), file, expected)
}


================================================
FILE: fileutils/go.mod
================================================
module github.com/go-openapi/swag/fileutils

require github.com/go-openapi/testify/v2 v2.5.0

go 1.25.0


================================================
FILE: fileutils/go.sum
================================================
github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=
github.com/go-openapi/testify/v2 v2.5.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=


================================================
FILE: fileutils/path.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package fileutils

import (
	"os"
	"path/filepath"
	"runtime"
	"strings"
)

// GOPATHKey represents the env key for gopath
const GOPATHKey = "GOPATH"

// FindInSearchPath finds a package in a provided lists of paths
func FindInSearchPath(searchPath, pkg string) string {
	pathsList := filepath.SplitList(searchPath)
	for _, path := range pathsList {
		if evaluatedPath, err := filepath.EvalSymlinks(filepath.Join(path, "src", pkg)); err == nil {
			if _, err := os.Stat(evaluatedPath); err == nil {
				return evaluatedPath
			}
		}
	}
	return ""
}

// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
//
// Deprecated: this function is no longer relevant with modern go.
// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24.
func FindInGoSearchPath(pkg string) string {
	return FindInSearchPath(FullGoSearchPath(), pkg)
}

// FullGoSearchPath gets the search paths for finding packages
//
// Deprecated: this function is no longer relevant with modern go.
// It uses [runtime.GOROOT] under the hood, which is deprecated as of go1.24.
func FullGoSearchPath() string {
	allPaths := os.Getenv(GOPATHKey)
	if allPaths == "" {
		allPaths = filepath.Join(os.Getenv("HOME"), "go")
	}
	if allPaths != "" {
		allPaths = strings.Join([]string{allPaths, runtime.GOROOT()}, ":")
	} else {
		allPaths = runtime.GOROOT()
	}
	return allPaths
}


================================================
FILE: fileutils/path_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package fileutils

import (
	"os"
	"path"
	"path/filepath"
	"runtime"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

func makeDirStructure(tb testing.TB, tgt string) (string, string) {
	_ = tgt

	tb.Helper()

	td := tb.TempDir()
	realPath := filepath.Join(td, "src", "foo", "bar")
	err := os.MkdirAll(realPath, os.ModePerm)
	require.NoError(tb, err)
	linkPathBase := filepath.Join(td, "src", "baz")
	err = os.MkdirAll(linkPathBase, os.ModePerm)
	require.NoError(tb, err)
	linkPath := filepath.Join(linkPathBase, "das")
	err = os.Symlink(realPath, linkPath)
	require.NoError(tb, err)

	td2 := tb.TempDir()
	realPath = filepath.Join(td2, "src", "fuu", "bir")
	err = os.MkdirAll(realPath, os.ModePerm)
	require.NoError(tb, err)
	linkPathBase = filepath.Join(td2, "src", "biz")
	err = os.MkdirAll(linkPathBase, os.ModePerm)
	require.NoError(tb, err)
	linkPath = filepath.Join(linkPathBase, "dis")
	err = os.Symlink(realPath, linkPath)
	require.NoError(tb, err)
	return td, td2
}

func TestFindPackage(t *testing.T) {
	pth, pth2 := makeDirStructure(t, "")

	searchPath := pth + string(filepath.ListSeparator) + pth2
	// finds package when real name mentioned
	pkg := FindInSearchPath(searchPath, "foo/bar")
	assert.NotEmpty(t, pkg)
	assertPath(t, path.Join(pth, "src", "foo", "bar"), pkg)
	// finds package when real name is mentioned in secondary
	pkg = FindInSearchPath(searchPath, "fuu/bir")
	assert.NotEmpty(t, pkg)
	assertPath(t, path.Join(pth2, "src", "fuu", "bir"), pkg)
	// finds package when symlinked
	pkg = FindInSearchPath(searchPath, "baz/das")
	assert.NotEmpty(t, pkg)
	assertPath(t, path.Join(pth, "src", "foo", "bar"), pkg)
	// finds package when symlinked in secondary
	pkg = FindInSearchPath(searchPath, "biz/dis")
	assert.NotEmpty(t, pkg)
	assertPath(t, path.Join(pth2, "src", "fuu", "bir"), pkg)
	// return empty string when nothing is found
	pkg = FindInSearchPath(searchPath, "not/there")
	assert.Empty(t, pkg)
}

//nolint:unparam
func assertPath(t testing.TB, expected, actual string) bool {
	fp, err := filepath.EvalSymlinks(expected)
	require.NoError(t, err)

	return assert.EqualT(t, fp, actual)
}

func TestFullGOPATH(t *testing.T) {
	os.Unsetenv(GOPATHKey)
	ngp := "/some/where:/other/place"
	t.Setenv(GOPATHKey, ngp)

	expected := ngp + ":" + runtime.GOROOT() //nolint: staticcheck // this is a deprecated function
	assert.EqualT(t, expected, FullGoSearchPath())
}


================================================
FILE: fileutils_iface.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import "github.com/go-openapi/swag/fileutils"

// GOPATHKey represents the env key for gopath
//
// Deprecated: use [fileutils.GOPATHKey] instead.
const GOPATHKey = fileutils.GOPATHKey

// File represents an uploaded file.
//
// Deprecated: use [fileutils.File] instead.
type File = fileutils.File

// FindInSearchPath finds a package in a provided lists of paths.
//
// Deprecated: use [fileutils.FindInSearchPath] instead.
func FindInSearchPath(searchPath, pkg string) string {
	return fileutils.FindInSearchPath(searchPath, pkg)
}

// FindInGoSearchPath finds a package in the $GOPATH:$GOROOT
//
// Deprecated: use [fileutils.FindInGoSearchPath] instead.
func FindInGoSearchPath(pkg string) string { return fileutils.FindInGoSearchPath(pkg) }

// FullGoSearchPath gets the search paths for finding packages
//
// Deprecated: use [fileutils.FullGoSearchPath] instead.
func FullGoSearchPath() string { return fileutils.FullGoSearchPath() }


================================================
FILE: fileutils_iface_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import (
	"os"
	"path/filepath"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

func TestFileUtilsIface(t *testing.T) {
	t.Run("deprecated functions should work", func(t *testing.T) {
		t.Run("with test package path", func(t *testing.T) {
			td := t.TempDir()

			realPath := filepath.Join(td, "src", "foo", "bar")
			require.NoError(t, os.MkdirAll(realPath, os.ModePerm))

			assert.NotEmpty(t, FindInSearchPath(td, "foo/bar"))
		})

		// The following functions are environment-dependant and difficult to test.
		// Deferred to in-package unit testing.
		assert.NotPanics(t, func() {
			_ = FullGoSearchPath()
		})
		assert.NotPanics(t, func() {
			_ = FindInGoSearchPath("github.com/go-openapi/swag")
		})
	})
}


================================================
FILE: go.mod
================================================
module github.com/go-openapi/swag

retract v0.24.0 // bad tagging of the main module: superseeded by v0.24.1

require (
	github.com/go-openapi/swag/cmdutils v0.26.0
	github.com/go-openapi/swag/conv v0.26.0
	github.com/go-openapi/swag/fileutils v0.26.0
	github.com/go-openapi/swag/jsonname v0.26.0
	github.com/go-openapi/swag/jsonutils v0.26.0
	github.com/go-openapi/swag/loading v0.26.0
	github.com/go-openapi/swag/mangling v0.26.0
	github.com/go-openapi/swag/netutils v0.26.0
	github.com/go-openapi/swag/stringutils v0.26.0
	github.com/go-openapi/swag/typeutils v0.26.0
	github.com/go-openapi/swag/yamlutils v0.26.0
	github.com/go-openapi/testify/v2 v2.5.0
)

require go.yaml.in/yaml/v3 v3.0.4 // indirect

replace (
	github.com/go-openapi/swag/cmdutils => ./cmdutils
	github.com/go-openapi/swag/conv => ./conv
	github.com/go-openapi/swag/fileutils => ./fileutils
	github.com/go-openapi/swag/jsonname => ./jsonname
	github.com/go-openapi/swag/jsonutils => ./jsonutils
	github.com/go-openapi/swag/jsonutils/fixtures_test => ./jsonutils/fixtures_test
	github.com/go-openapi/swag/loading => ./loading
	github.com/go-openapi/swag/mangling => ./mangling
	github.com/go-openapi/swag/netutils => ./netutils
	github.com/go-openapi/swag/stringutils => ./stringutils
	github.com/go-openapi/swag/typeutils => ./typeutils
	github.com/go-openapi/swag/yamlutils => ./yamlutils
)

go 1.25.0


================================================
FILE: go.sum
================================================
github.com/go-openapi/testify/enable/yaml/v2 v2.4.2 h1:5zRca5jw7lzVREKCZVNBpysDNBjj74rBh0N2BGQbSR0=
github.com/go-openapi/testify/enable/yaml/v2 v2.4.2/go.mod h1:XVevPw5hUXuV+5AkI1u1PeAm27EQVrhXTTCPAF85LmE=
github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=
github.com/go-openapi/testify/v2 v2.5.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=


================================================
FILE: go.work
================================================
use (
	.
	./cmdutils
	./conv
	./fileutils
	./jsonname
	./jsonutils
	./jsonutils/adapters/easyjson
	./jsonutils/adapters/testintegration
	./jsonutils/adapters/testintegration/benchmarks
	./jsonutils/fixtures_test
	./loading
	./mangling
	./netutils
	./stringutils
	./typeutils
	./yamlutils
)

go 1.25.0


================================================
FILE: go.work.sum
================================================
github.com/go-openapi/testify/v2 v2.0.1/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=


================================================
FILE: hack/.gitkeep
================================================


================================================
FILE: jsonname/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package jsonname is a provider of json property names from go properties.
package jsonname


================================================
FILE: jsonname/go.mod
================================================
module github.com/go-openapi/swag/jsonname

require github.com/go-openapi/testify/v2 v2.5.0

go 1.25.0


================================================
FILE: jsonname/go.sum
================================================
github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=
github.com/go-openapi/testify/v2 v2.5.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=


================================================
FILE: jsonname/go_name_provider.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package jsonname

import (
	"reflect"
	"strings"
	"sync"
)

var _ providerIface = (*GoNameProvider)(nil)

// GoNameProvider resolves json property names to go struct field names following
// the same rules as the standard library's [encoding/json] package.
//
// Contrary to [NameProvider], it considers exported fields without a json tag,
// and promotes fields from anonymous embedded struct types.
//
// Rules (aligned with encoding/json):
//
//   - unexported fields are ignored;
//   - a field tagged `json:"-"` is ignored;
//   - a field tagged `json:"-,"` is kept under the json name "-" (stdlib quirk);
//   - a field tagged `json:""` or with no json tag at all keeps its Go name as json name;
//   - anonymous struct fields without an explicit json tag have their fields
//     promoted into the parent, following breadth-first depth rules:
//     a shallower field wins over a deeper one; at equal depth, a conflict
//     discards all conflicting fields unless exactly one has an explicit json tag.
//
// This type is safe for concurrent use.
type GoNameProvider struct {
	lock  sync.Mutex
	index map[reflect.Type]nameIndex
}

// NewGoNameProvider creates a new [GoNameProvider].
func NewGoNameProvider() *GoNameProvider {
	return &GoNameProvider{
		index: make(map[reflect.Type]nameIndex),
	}
}

// GetJSONNames gets all the json property names for a type.
func (n *GoNameProvider) GetJSONNames(subject any) []string {
	n.lock.Lock()
	defer n.lock.Unlock()

	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	names := n.nameIndexFor(tpe)

	res := make([]string, 0, len(names.jsonNames))
	for k := range names.jsonNames {
		res = append(res, k)
	}

	return res
}

// GetJSONName gets the json name for a go property name.
func (n *GoNameProvider) GetJSONName(subject any, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()

	return n.GetJSONNameForType(tpe, name)
}

// GetJSONNameForType gets the json name for a go property name on a given type.
func (n *GoNameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
	n.lock.Lock()
	defer n.lock.Unlock()

	names := n.nameIndexFor(tpe)
	nme, ok := names.goNames[name]

	return nme, ok
}

// GetGoName gets the go name for a json property name.
func (n *GoNameProvider) GetGoName(subject any, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()

	return n.GetGoNameForType(tpe, name)
}

// GetGoNameForType gets the go name for a given type for a json property name.
func (n *GoNameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
	n.lock.Lock()
	defer n.lock.Unlock()

	names := n.nameIndexFor(tpe)
	nme, ok := names.jsonNames[name]

	return nme, ok
}

func (n *GoNameProvider) nameIndexFor(tpe reflect.Type) nameIndex {
	if names, ok := n.index[tpe]; ok {
		return names
	}

	names := buildGoNameIndex(tpe)
	n.index[tpe] = names

	return names
}

// fieldEntry captures a candidate field discovered while walking a struct
// along with the indirection path from the root type (used to resolve conflicts
// by depth in the same way encoding/json does).
type fieldEntry struct {
	goName   string
	jsonName string
	index    []int
	tagged   bool
}

func buildGoNameIndex(tpe reflect.Type) nameIndex {
	fields := collectGoFields(tpe)

	idx := make(map[string]string, len(fields))
	reverseIdx := make(map[string]string, len(fields))
	for _, f := range fields {
		idx[f.jsonName] = f.goName
		reverseIdx[f.goName] = f.jsonName
	}

	return nameIndex{jsonNames: idx, goNames: reverseIdx}
}

// collectGoFields walks tpe breadth-first along anonymous struct fields,
// reproducing the field selection performed by encoding/json.typeFields.
func collectGoFields(tpe reflect.Type) []fieldEntry {
	if tpe.Kind() != reflect.Struct {
		return nil
	}

	type queued struct {
		typ   reflect.Type
		index []int
	}

	current := []queued{}
	next := []queued{{typ: tpe}}
	visited := map[reflect.Type]bool{tpe: true}

	var (
		candidates []fieldEntry
		count      = map[string]int{}
		nextCount  = map[string]int{}
	)

	for len(next) > 0 {
		current, next = next, current[:0]
		count, nextCount = nextCount, count
		for k := range nextCount {
			delete(nextCount, k)
		}

		for _, q := range current {
			for i := 0; i < q.typ.NumField(); i++ {
				sf := q.typ.Field(i)

				if sf.Anonymous {
					ft := sf.Type
					if ft.Kind() == reflect.Ptr {
						ft = ft.Elem()
					}
					if !sf.IsExported() && ft.Kind() != reflect.Struct {
						continue
					}
				} else if !sf.IsExported() {
					continue
				}

				tag := sf.Tag.Get("json")
				if tag == "-" {
					continue
				}
				jsonName, _ := parseJSONTag(tag)
				tagged := jsonName != ""

				ft := sf.Type
				if ft.Kind() == reflect.Ptr {
					ft = ft.Elem()
				}

				if sf.Anonymous && ft.Kind() == reflect.Struct && !tagged {
					if visited[ft] {
						continue
					}
					visited[ft] = true

					index := make([]int, len(q.index)+1)
					copy(index, q.index)
					index[len(q.index)] = i
					next = append(next, queued{typ: ft, index: index})

					continue
				}

				name := jsonName
				if name == "" {
					name = sf.Name
				}

				index := make([]int, len(q.index)+1)
				copy(index, q.index)
				index[len(q.index)] = i

				candidates = append(candidates, fieldEntry{
					goName:   sf.Name,
					jsonName: name,
					index:    index,
					tagged:   tagged,
				})
				nextCount[name]++
			}
		}
	}

	return dominantFields(candidates)
}

// dominantFields applies the Go encoding/json conflict resolution rules:
// at each JSON name, the shallowest field wins; at equal depth, a uniquely
// tagged candidate wins; otherwise all candidates for that name are dropped.
func dominantFields(candidates []fieldEntry) []fieldEntry {
	byName := make(map[string][]fieldEntry, len(candidates))
	for _, c := range candidates {
		byName[c.jsonName] = append(byName[c.jsonName], c)
	}

	out := make([]fieldEntry, 0, len(byName))
	for _, group := range byName {
		if len(group) == 1 {
			out = append(out, group[0])

			continue
		}

		minDepth := len(group[0].index)
		for _, c := range group[1:] {
			if len(c.index) < minDepth {
				minDepth = len(c.index)
			}
		}

		var shallow []fieldEntry
		for _, c := range group {
			if len(c.index) == minDepth {
				shallow = append(shallow, c)
			}
		}

		if len(shallow) == 1 {
			out = append(out, shallow[0])

			continue
		}

		var tagged []fieldEntry
		for _, c := range shallow {
			if c.tagged {
				tagged = append(tagged, c)
			}
		}
		if len(tagged) == 1 {
			out = append(out, tagged[0])
		}
	}

	return out
}

// parseJSONTag returns the name component of a json struct tag and whether
// it carried any non-name option (kept for future-proofing, e.g. "omitempty").
func parseJSONTag(tag string) (string, string) {
	if tag == "" {
		return "", ""
	}
	if idx := strings.IndexByte(tag, ','); idx >= 0 {
		return tag[:idx], tag[idx+1:]
	}

	return tag, ""
}


================================================
FILE: jsonname/go_name_provider_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package jsonname

import (
	"encoding/json"
	"reflect"
	"sort"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
	"github.com/go-openapi/testify/v2/require"
)

type testAltEmbedded struct {
	Nested string `json:"nested"`
}

type testAltDeep struct {
	Deep string `json:"deep"`
}

type testAltMiddle struct {
	testAltDeep

	Middle string `json:"middle"`
}

// testAltStruct exercises the stdlib-aligned field discovery rules:
//   - Name: explicitly tagged
//   - NotTheSame: tagged with a different json name
//   - Ignored: fully excluded via `json:"-"`
//   - DashField: stdlib quirk, literally named "-" in json
//   - Untagged: empty name in tag → keeps Go name
//   - Optional: options-only tag → keeps Go name
//   - NoTag: no tag at all → keeps Go name
//   - unexported: excluded
//   - testAltEmbedded: fields promoted to the parent
//   - testAltMiddle: embedded struct itself embedding another → transitively promoted
type testAltStruct struct {
	testAltEmbedded
	testAltMiddle

	Name       string `json:"name"`
	NotTheSame int64  `json:"plain"`
	Ignored    string `json:"-"`
	DashField  string `json:"-,"` //nolint:staticcheck  // deliberate: exercise stdlib "-," quirk
	Untagged   string `json:""`
	Optional   string `json:",omitempty"`
	NoTag      string
	unexported string //nolint:unused  // exercised to confirm it is filtered out
}

// testAltShadow verifies the depth-based conflict resolution: the outer field
// must win over one promoted from an embedded type.
type testAltShadow struct {
	testAltEmbedded

	Nested string `json:"nested"`
}

func TestGoNameProvider(t *testing.T) {
	provider := NewGoNameProvider()
	obj := testAltStruct{}
	tpe := reflect.TypeOf(obj)
	ptr := &obj

	t.Run("GetGoName resolves tagged fields", func(t *testing.T) {
		for _, tc := range []struct {
			jsonName string
			goName   string
		}{
			{"name", "Name"},
			{"plain", "NotTheSame"},
			{"-", "DashField"}, // stdlib `json:"-,"` quirk
			{"Untagged", "Untagged"},
			{"Optional", "Optional"},
			{"NoTag", "NoTag"},
			{"nested", "Nested"},
			{"middle", "Middle"},
			{"deep", "Deep"},
		} {
			nm, ok := provider.GetGoName(obj, tc.jsonName)
			assert.TrueT(t, ok, "expected json name %q to resolve", tc.jsonName)
			assert.EqualT(t, tc.goName, nm)
		}
	})

	t.Run("GetGoName rejects excluded or unknown names", func(t *testing.T) {
		for _, bad := range []string{"ignored", "Ignored", "unexported", "doesNotExist"} {
			nm, ok := provider.GetGoName(obj, bad)
			assert.FalseT(t, ok, "did not expect %q to resolve", bad)
			assert.Empty(t, nm)
		}
	})

	t.Run("GetGoNameForType mirrors GetGoName", func(t *testing.T) {
		nm, ok := provider.GetGoNameForType(tpe, "plain")
		assert.TrueT(t, ok)
		assert.EqualT(t, "NotTheSame", nm)

		_, ok = provider.GetGoNameForType(tpe, "doesNotExist")
		assert.FalseT(t, ok)
	})

	t.Run("GetGoName accepts pointer subjects", func(t *testing.T) {
		nm, ok := provider.GetGoName(ptr, "name")
		assert.TrueT(t, ok)
		assert.EqualT(t, "Name", nm)

		nm, ok = provider.GetGoName(ptr, "nested")
		assert.TrueT(t, ok)
		assert.EqualT(t, "Nested", nm)
	})

	t.Run("GetJSONName is the inverse mapping", func(t *testing.T) {
		for _, tc := range []struct {
			goName   string
			jsonName string
		}{
			{"Name", "name"},
			{"NotTheSame", "plain"},
			{"DashField", "-"},
			{"Untagged", "Untagged"},
			{"Optional", "Optional"},
			{"NoTag", "NoTag"},
			{"Nested", "nested"},
			{"Middle", "middle"},
			{"Deep", "deep"},
		} {
			nm, ok := provider.GetJSONName(obj, tc.goName)
			assert.TrueT(t, ok, "expected go name %q to resolve", tc.goName)
			assert.EqualT(t, tc.jsonName, nm)
		}

		_, ok := provider.GetJSONName(obj, "Ignored")
		assert.FalseT(t, ok)

		_, ok = provider.GetJSONNameForType(tpe, "DoesNotExist")
		assert.FalseT(t, ok)
	})

	t.Run("GetJSONNames lists every discoverable field exactly once", func(t *testing.T) {
		names := provider.GetJSONNames(ptr)
		sort.Strings(names)
		assert.Equal(t, []string{
			"-",
			"NoTag",
			"Optional",
			"Untagged",
			"deep",
			"middle",
			"name",
			"nested",
			"plain",
		}, names)
	})

	t.Run("index caches per type", func(t *testing.T) {
		// Re-query to confirm no duplicate entries are created on repeat access.
		_, _ = provider.GetGoName(obj, "name")
		_, _ = provider.GetGoName(ptr, "name")
		assert.Len(t, provider.index, 1)
	})
}

// TestGoNameProvider_ShadowingMatchesStdlib pins our field selection to the
// behavior of encoding/json for shadowed promoted fields.
func TestGoNameProvider_ShadowingMatchesStdlib(t *testing.T) {
	provider := NewGoNameProvider()
	payload := `{"nested":"outer"}`

	var s testAltShadow
	require.NoError(t, json.Unmarshal([]byte(payload), &s))
	assert.Equal(t, "outer", s.Nested)
	assert.Empty(t, s.testAltEmbedded.Nested)

	goName, ok := provider.GetGoName(s, "nested")
	require.True(t, ok)
	// The outer field wins, exactly like encoding/json would pick s.Nested.
	assert.Equal(t, "Nested", goName)

	names := provider.GetJSONNames(s)
	assert.Len(t, names, 1)
}

// TestGoNameProvider_ImplementsInterface is a compile-time-ish guard that both
// providers agree on the core lookup shape expected by consumers.
func TestGoNameProvider_ImplementsInterface(t *testing.T) {
	var p providerIface = NewGoNameProvider()
	_, ok := p.GetGoName(testAltStruct{}, "name")
	assert.True(t, ok)
}

// Fixtures for the embedded-type promotion scenarios.

type testAltInner struct {
	Foo string `json:"foo"`
	Bar string
}

type testAltPromoted struct {
	testAltInner

	Baz string `json:"baz"`
}

type testAltTaggedEmbed struct {
	testAltInner `json:"inner"`

	Baz string `json:"baz"`
}

type testAltPtrEmbed struct {
	*testAltInner

	Baz string `json:"baz"`
}

type testAltUnexportedEmbed struct {
	testAltInner // exported type, will still promote

	inner testAltInner //nolint:unused  // regular unexported field, must be ignored
}

// TestGoNameProvider_EmbeddedPromotion validates how the provider resolves
// fields coming from an exported embedded type, mirroring encoding/json.
func TestGoNameProvider_EmbeddedPromotion(t *testing.T) {
	t.Run("untagged embedded struct promotes its fields", func(t *testing.T) {
		provider := NewGoNameProvider()
		obj := testAltPromoted{}

		for _, tc := range []struct {
			jsonName string
			goName   string
		}{
			{"foo", "Foo"}, // promoted, tagged on Inner
			{"Bar", "Bar"}, // promoted, untagged on Inner -> Go name kept
			{"baz", "Baz"}, // declared on Outer
		} {
			nm, ok := provider.GetGoName(obj, tc.jsonName)
			assert.TrueT(t, ok, "expected %q to resolve", tc.jsonName)
			assert.EqualT(t, tc.goName, nm)
		}

		// "Inner" must NOT appear as its own json name: its fields were promoted.
		_, ok := provider.GetJSONName(obj, "testAltInner")
		assert.False(t, ok)

		names := provider.GetJSONNames(obj)
		sort.Strings(names)
		assert.Equal(t, []string{"Bar", "baz", "foo"}, names)
	})

	t.Run("tagged embedded struct is treated as a regular named field", func(t *testing.T) {
		provider := NewGoNameProvider()
		obj := testAltTaggedEmbed{}

		nm, ok := provider.GetGoName(obj, "inner")
		assert.TrueT(t, ok)
		assert.EqualT(t, "testAltInner", nm)

		// With the tag in place, Inner's fields are NOT promoted.
		_, ok = provider.GetGoName(obj, "foo")
		assert.False(t, ok)
		_, ok = provider.GetGoName(obj, "Bar")
		assert.False(t, ok)

		names := provider.GetJSONNames(obj)
		sort.Strings(names)
		assert.Equal(t, []string{"baz", "inner"}, names)
	})

	t.Run("pointer-to-struct embedded is promoted like its elem", func(t *testing.T) {
		provider := NewGoNameProvider()
		obj := testAltPtrEmbed{}

		nm, ok := provider.GetGoName(obj, "foo")
		assert.TrueT(t, ok)
		assert.EqualT(t, "Foo", nm)

		names := provider.GetJSONNames(obj)
		sort.Strings(names)
		assert.Equal(t, []string{"Bar", "baz", "foo"}, names)
	})

	t.Run("regular unexported field alongside promotion does not leak", func(t *testing.T) {
		provider := NewGoNameProvider()
		obj := testAltUnexportedEmbed{}

		// Promotion still works for the exported embedded type.
		nm, ok := provider.GetGoName(obj, "foo")
		assert.TrueT(t, ok)
		assert.EqualT(t, "Foo", nm)

		// The regular unexported "inner" field must be invisible.
		_, ok = provider.GetGoName(obj, "inner")
		assert.False(t, ok)
	})

	t.Run("agrees with encoding/json on roundtrip", func(t *testing.T) {
		provider := NewGoNameProvider()
		payload := `{"foo":"f","Bar":"b","baz":"z"}`

		var stdVal testAltPromoted
		require.NoError(t, json.Unmarshal([]byte(payload), &stdVal))
		assert.Equal(t, "f", stdVal.Foo)
		assert.Equal(t, "b", stdVal.Bar)
		assert.Equal(t, "z", stdVal.Baz)

		// For every json key encoding/json accepted, the provider must resolve it too.
		for _, key := range []string{"foo", "Bar", "baz"} {
			_, ok := provider.GetGoName(stdVal, key)
			assert.TrueT(t, ok, "provider should resolve %q like encoding/json", key)
		}
	})
}


================================================
FILE: jsonname/ifaces.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package jsonname

import "reflect"

// providerIface is an unexported compile-time contract that every name provider
// in this package is expected to satisfy.
// It mirrors the interface declared by the main consumer of this module: [github.com/go-openapi/jsonpointer.NameProvider].
type providerIface interface {
	GetGoName(subject any, name string) (string, bool)
	GetGoNameForType(tpe reflect.Type, name string) (string, bool)
}


================================================
FILE: jsonname/name_provider.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package jsonname

import (
	"reflect"
	"strings"
	"sync"
)

// DefaultJSONNameProvider is the default cache for types.
var DefaultJSONNameProvider = NewNameProvider()

var _ providerIface = (*NameProvider)(nil)

// NameProvider represents an object capable of translating from go property names
// to json property names.
//
// This type is thread-safe.
//
// See [github.com/go-openapi/jsonpointer.Pointer] for an example.
type NameProvider struct {
	lock  *sync.Mutex
	index map[reflect.Type]nameIndex
}

type nameIndex struct {
	jsonNames map[string]string
	goNames   map[string]string
}

// NewNameProvider creates a new name provider
func NewNameProvider() *NameProvider {
	return &NameProvider{
		lock:  &sync.Mutex{},
		index: make(map[reflect.Type]nameIndex),
	}
}

func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
	for i := 0; i < tpe.NumField(); i++ {
		targetDes := tpe.Field(i)

		if targetDes.PkgPath != "" { // unexported
			continue
		}

		if targetDes.Anonymous { // walk embedded structures tree down first
			buildnameIndex(targetDes.Type, idx, reverseIdx)
			continue
		}

		if tag := targetDes.Tag.Get("json"); tag != "" {

			parts := strings.Split(tag, ",")
			if len(parts) == 0 {
				continue
			}

			nm := parts[0]
			if nm == "-" {
				continue
			}
			if nm == "" { // empty string means we want to use the Go name
				nm = targetDes.Name
			}

			idx[nm] = targetDes.Name
			reverseIdx[targetDes.Name] = nm
		}
	}
}

func newNameIndex(tpe reflect.Type) nameIndex {
	var idx = make(map[string]string, tpe.NumField())
	var reverseIdx = make(map[string]string, tpe.NumField())

	buildnameIndex(tpe, idx, reverseIdx)
	return nameIndex{jsonNames: idx, goNames: reverseIdx}
}

// GetJSONNames gets all the json property names for a type
func (n *NameProvider) GetJSONNames(subject any) []string {
	n.lock.Lock()
	defer n.lock.Unlock()
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	names, ok := n.index[tpe]
	if !ok {
		names = n.makeNameIndex(tpe)
	}

	res := make([]string, 0, len(names.jsonNames))
	for k := range names.jsonNames {
		res = append(res, k)
	}
	return res
}

// GetJSONName gets the json name for a go property name
func (n *NameProvider) GetJSONName(subject any, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	return n.GetJSONNameForType(tpe, name)
}

// GetJSONNameForType gets the json name for a go property name on a given type
func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name string) (string, bool) {
	n.lock.Lock()
	defer n.lock.Unlock()
	names, ok := n.index[tpe]
	if !ok {
		names = n.makeNameIndex(tpe)
	}
	nme, ok := names.goNames[name]
	return nme, ok
}

// GetGoName gets the go name for a json property name
func (n *NameProvider) GetGoName(subject any, name string) (string, bool) {
	tpe := reflect.Indirect(reflect.ValueOf(subject)).Type()
	return n.GetGoNameForType(tpe, name)
}

// GetGoNameForType gets the go name for a given type for a json property name
func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string) (string, bool) {
	n.lock.Lock()
	defer n.lock.Unlock()
	names, ok := n.index[tpe]
	if !ok {
		names = n.makeNameIndex(tpe)
	}
	nme, ok := names.jsonNames[name]
	return nme, ok
}

func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
	names := newNameIndex(tpe)
	n.index[tpe] = names
	return names
}


================================================
FILE: jsonname/name_provider_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package jsonname

import (
	"reflect"
	"testing"

	"github.com/go-openapi/testify/v2/assert"
)

type testNameStruct struct {
	Name       string `json:"name"`
	NotTheSame int64  `json:"plain"`
	Ignored    string `json:"-"`
}

func TestNameProvider(t *testing.T) {
	provider := NewNameProvider()

	var obj = testNameStruct{}

	nm, ok := provider.GetGoName(obj, "name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "Name", nm)

	nm, ok = provider.GetGoName(obj, "plain")
	assert.TrueT(t, ok)
	assert.EqualT(t, "NotTheSame", nm)

	nm, ok = provider.GetGoName(obj, "doesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetGoName(obj, "ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	tpe := reflect.TypeOf(obj)
	nm, ok = provider.GetGoNameForType(tpe, "name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "Name", nm)

	nm, ok = provider.GetGoNameForType(tpe, "plain")
	assert.TrueT(t, ok)
	assert.EqualT(t, "NotTheSame", nm)

	nm, ok = provider.GetGoNameForType(tpe, "doesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetGoNameForType(tpe, "ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	ptr := &obj
	nm, ok = provider.GetGoName(ptr, "name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "Name", nm)

	nm, ok = provider.GetGoName(ptr, "plain")
	assert.TrueT(t, ok)
	assert.EqualT(t, "NotTheSame", nm)

	nm, ok = provider.GetGoName(ptr, "doesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetGoName(ptr, "ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONName(obj, "Name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "name", nm)

	nm, ok = provider.GetJSONName(obj, "NotTheSame")
	assert.TrueT(t, ok)
	assert.EqualT(t, "plain", nm)

	nm, ok = provider.GetJSONName(obj, "DoesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONName(obj, "Ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONNameForType(tpe, "Name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "name", nm)

	nm, ok = provider.GetJSONNameForType(tpe, "NotTheSame")
	assert.TrueT(t, ok)
	assert.EqualT(t, "plain", nm)

	nm, ok = provider.GetJSONNameForType(tpe, "doesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONNameForType(tpe, "Ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONName(ptr, "Name")
	assert.TrueT(t, ok)
	assert.EqualT(t, "name", nm)

	nm, ok = provider.GetJSONName(ptr, "NotTheSame")
	assert.TrueT(t, ok)
	assert.EqualT(t, "plain", nm)

	nm, ok = provider.GetJSONName(ptr, "doesNotExist")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nm, ok = provider.GetJSONName(ptr, "Ignored")
	assert.FalseT(t, ok)
	assert.Empty(t, nm)

	nms := provider.GetJSONNames(ptr)
	assert.Len(t, nms, 2)

	assert.Len(t, provider.index, 1)
}


================================================
FILE: jsonname_iface.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import (
	"github.com/go-openapi/swag/jsonname"
)

// DefaultJSONNameProvider is the default cache for types
//
// Deprecated: use [jsonname.DefaultJSONNameProvider] instead.
var DefaultJSONNameProvider = jsonname.DefaultJSONNameProvider

// NameProvider represents an object capable of translating from go property names
// to json property names.
//
// Deprecated: use [jsonname.NameProvider] instead.
type NameProvider = jsonname.NameProvider

// NewNameProvider creates a new name provider
//
// Deprecated: use [jsonname.NewNameProvider] instead.
func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() }


================================================
FILE: jsonname_iface_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package swag

import (
	"testing"

	"github.com/go-openapi/testify/v2/assert"
)

func TestJSONNameIface(t *testing.T) {
	t.Run("deprecated functions should work", func(t *testing.T) {
		assert.NotNil(t, NewNameProvider())
	})
}


================================================
FILE: jsonutils/README.md
================================================
# jsonutils

`jsonutils` exposes a few tools to work with JSON:

- a fast, simple `Concat` to concatenate (not merge) JSON objects and arrays
- `FromDynamicJSON` to convert a data structure into a "dynamic JSON" data structure
- `ReadJSON` and `WriteJSON` behave like `json.Unmarshal` and `json.Marshal`,
   with the ability to use another underlying serialization library through an `Adapter`
   configured at runtime
- a `JSONMapSlice` structure that may be used to store JSON objects with the order of keys maintained

## Dynamic JSON

We call "dynamic JSON" the go data structure that results from unmarshaling JSON like this:

```go
  var value any
  jsonBytes := `{"a": 1, ... }`
  _ = json.Unmarshal(jsonBytes, &value)
```

In this configuration, the standard library mappings are as follows:

| JSON      | go               |
|-----------|------------------|
| `number`  | `float64`        |
| `string`  | `string`         |
| `boolean` | `bool`           |
| `null`    | `nil`            |
| `object`  | `map[string]any` |
| `array`   | `[]any`          |

## Map slices

When using `JSONMapSlice`, the ordering of keys is ensured by replacing
mappings to `map[string]any` by a `JSONMapSlice` which is an (ordered)
slice of `JSONMapItem`s.

Notice that a similar feature is available for YAML (see [`yamlutils`](../yamlutils)),
with a `YAMLMapSlice` type based on the `JSONMapSlice`.

`JSONMapSlice` is similar to an ordered map, but the keys are not retrieved
in constant time.

Another difference with the the above standard mappings is that numbers don't always map
to a `float64`: if the value is a JSON integer, it unmarshals to `int64`.

See also [some examples](https://pkg.go.dev/github.com/go-openapi/swag/jsonutils#pkg-examples)

## Adapters

`ReadJSON`, `WriteJSON` and `FromDynamicJSON` (which is a combination of the latter two)
are wrappers on top of `json.Unmarshal` and `json.Marshal`.

By default, the adapter merely wraps the standard library.

The adapter may be used to register other JSON serialization libraries,
possibly several ones at the same time.

If the value passed is identified as an "ordered map" (i.e. implements `ifaces.Ordered`
or `ifaces.SetOrdered`, the adapter favors the "ordered" JSON behavior and tries to
find a registered implementation that support ordered keys in objects.

Our standard library implementation supports this.

As of `v0.25.0`, we support through such an adapter the popular `mailru/easyjson`
library, which kicks in when the passed values support the `easyjson.Unmarshaler`
or `easyjson.Marshaler` interfaces.

In the future, we plan to add more similar libraries that compete on the go JSON
serializers scene.

## Registering an adapter

In package `github.com/go-openapi/swag/easyjson/adapters`, several adapters are available.

Each adapter is an independent go module. Hence you'll pick its dependencies only if you import it.

At this moment we provide:

- `stdlib`: JSON adapter based on the standard library
- `easyjson`: JSON adapter based on the `github.com/mailru/easyjson`

The adapters provide the basic `Marshal` and `Unmarshal` capabilities, plus an implementation
of the `MapSlice` pattern.

You may also build your own adapter based on your specific use-case. An adapter is not required to implement
all capabilities.

Every adapter comes with a `Register` function, possibly with some options, to register the adapter
to a global registry.

For example, to enable `easyjson` to be used in `ReadJSON` and `WriteJSON`, you would write something like:

```go
  import (
	  "github.com/go-openapi/swag/jsonutils/adapters"
	  easyjson "github.com/go-openapi/swag/jsonutils/adapters/easyjson/json"
  )

  func init() {
	  easyjson.Register(adapters.Registry)
  }
```

You may register several adapters. In this case, capability matching is evaluated from the last registered
adapters (LIFO).

## [Benchmarks](./adapters/testintegration/benchmarks/README.md)


================================================
FILE: jsonutils/adapters/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package adapters exposes a registry of adapters to multiple
// JSON serialization libraries.
//
// All interfaces are defined in package [ifaces.Adapter].
package adapters


================================================
FILE: jsonutils/adapters/easyjson/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package easyjson exposes a JSON adapter
// that leverages the [easyjson] serializer library.
//
// It ships as an independent go module.
//
// This library is significantly faster than the standard
// library, provided the data types implement its specific
// interfaces [easyjson.Marshaler] and [easyjson.Unmarshaler].
package easyjson

import (
	_ "github.com/mailru/easyjson" // for documentation purpose only
)


================================================
FILE: jsonutils/adapters/easyjson/go.mod
================================================
module github.com/go-openapi/swag/jsonutils/adapters/easyjson

require (
	github.com/go-openapi/swag/conv v0.26.0
	github.com/go-openapi/swag/jsonutils v0.25.4
	github.com/go-openapi/swag/jsonutils/fixtures_test v0.26.0
	github.com/go-openapi/swag/typeutils v0.26.0
	github.com/go-openapi/testify/v2 v2.5.0
	github.com/mailru/easyjson v0.9.2
)

require (
	github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 // indirect
	github.com/josharian/intern v1.0.0 // indirect
	go.yaml.in/yaml/v3 v3.0.4 // indirect
)

replace (
	github.com/go-openapi/swag/conv => ../../../conv
	github.com/go-openapi/swag/jsonutils => ../../../jsonutils
	github.com/go-openapi/swag/jsonutils/fixtures_test => ../../../jsonutils/fixtures_test
	github.com/go-openapi/swag/typeutils => ../../../typeutils
)

go 1.25.0


================================================
FILE: jsonutils/adapters/easyjson/go.sum
================================================
github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=
github.com/go-openapi/testify/enable/yaml/v2 v2.5.0/go.mod h1:TvDZKBH7ZbMaF3EqH2AwTvNQCmzyZq8K1agRjf1B+Nk=
github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=
github.com/go-openapi/testify/v2 v2.5.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M=
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=


================================================
FILE: jsonutils/adapters/easyjson/json/adapter.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package json

import (
	stdjson "encoding/json"

	"github.com/go-openapi/swag/jsonutils/adapters/ifaces"
	"github.com/go-openapi/swag/typeutils"
	"github.com/mailru/easyjson"
	"github.com/mailru/easyjson/jlexer"
	"github.com/mailru/easyjson/jwriter"
)

var _ ifaces.Adapter = &Adapter{}

type Adapter struct {
	options
}

// NewAdapter yields a JSON adapter for [easyjson].
func NewAdapter(opts ...Option) *Adapter {
	var o options
	for _, apply := range opts {
		apply(&o)
	}
	return &Adapter{
		options: o,
	}
}

func (a *Adapter) Marshal(value any) ([]byte, error) {
	marshaler, ok := value.(easyjson.Marshaler)
	if ok {
		w := BorrowWriter()
		defer func() {
			RedeemWriter(w)
		}()
		if a.nilMapAsEmpty {
			w.Flags |= jwriter.NilMapAsEmpty
		}
		if a.nilSliceAsEmpty {
			w.Flags |= jwriter.NilSliceAsEmpty
		}
		w.NoEscapeHTML = a.noEscapeHTML

		marshaler.MarshalEasyJSON(w)

		return w.BuildBytes() // this actually copies data, so its okay to redeem the writer
	}

	// fallback to standard library
	return stdjson.Marshal(value)
}

func (a *Adapter) Unmarshal(data []byte, value any) error {
	unmarshaler, ok := value.(easyjson.Unmarshaler)
	if ok {
		l := BorrowLexer(data)
		defer func() {
			RedeemLexer(l)
		}()
		l.UseMultipleErrors = a.useMultipleErrors

		unmarshaler.UnmarshalEasyJSON(l)
		return l.Error()
	}

	return stdjson.Unmarshal(data, value)
}

func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) {
	w := BorrowWriter()
	defer func() {
		RedeemWriter(w)
	}()

	if typeutils.IsNil(value) {
		w.RawString("null")

		return w.BuildBytes()
	}

	w.RawByte('{')
	first := true
	for k, v := range value.OrderedItems() {
		if first {
			first = false
		} else {
			w.RawByte(',')
		}

		w.String(k)
		w.RawByte(':')

		switch val := v.(type) {
		case easyjson.Marshaler:
			val.MarshalEasyJSON(w)
		case ifaces.Ordered:
			w.Raw(a.OrderedMarshal(val))
		default:
			w.Raw(stdjson.Marshal(v))
		}
	}

	w.RawByte('}')

	return w.BuildBytes() // this actually copies data, so its okay to redeem the writer
}

func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdered) error {
	var m MapSlice
	if err := m.OrderedUnmarshalJSON(data); err != nil {
		return err
	}

	if typeutils.IsNil(m) {
		// force input value to nil
		value.SetOrderedItems(nil)

		return nil
	}

	value.SetOrderedItems(m.OrderedItems())

	return nil
}

func (a *Adapter) NewOrderedMap(capacity int) ifaces.OrderedMap {
	m := make(MapSlice, 0, capacity)

	return &m
}

func (a *Adapter) Redeem() {
	if a == nil {
		return
	}
	RedeemAdapter(a)
}

func (a *Adapter) Reset() {
	a.options = options{}
}

func newJWriter() *jwriter.Writer {
	return &jwriter.Writer{
		Flags: jwriter.NilMapAsEmpty | jwriter.NilSliceAsEmpty,
	}
}

func newJLexer() *jlexer.Lexer {
	return &jlexer.Lexer{}
}


================================================
FILE: jsonutils/adapters/easyjson/json/adapter_test.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package json

import (
	"regexp"
	"testing"

	fixtures "github.com/go-openapi/swag/jsonutils/fixtures_test"
	"github.com/go-openapi/testify/v2/require"
)

func TestAdapter(t *testing.T) {
	const reasonableCapacity = 10
	a := BorrowAdapter()
	defer func() {
		RedeemAdapter(a)
	}()

	harness := fixtures.NewHarness(t)
	harness.Init()

	for name, test := range harness.AllTests(
		// in these test conditions we do not return nil when token is null, but an empty slice.
		fixtures.WithExcludePattern(regexp.MustCompile(`^with null value$`)),
	) {
		t.Run(name, func(t *testing.T) {
			t.Run("should Unmarshal JSON", func(t *testing.T) {
				value := a.NewOrderedMap(reasonableCapacity)

				if test.ExpectError() {
					require.Error(t, a.Unmarshal(test.JSONBytes(), value))

					return
				}

				require.NoError(t, a.Unmarshal(test.JSONBytes(), value))

				t.Run("should Marshal JSON with equivalent JSON", func(t *testing.T) {
					jazon, err := a.Marshal(value)
					require.NoError(t, err)

					require.JSONEqBytes(t, test.JSONBytes(), jazon)
				})
			})

			t.Run("should OrderedUnmarshal JSON", func(t *testing.T) {
				value := a.NewOrderedMap(reasonableCapacity)

				if test.ExpectError() {
					require.Error(t, a.OrderedUnmarshal(test.JSONBytes(), value))

					return
				}

				require.NoError(t, a.OrderedUnmarshal(test.JSONBytes(), value))

				t.Run("should OrderedMarshal JSON with identical JSON", func(t *testing.T) {
					jazon, err := a.OrderedMarshal(value)
					require.NoError(t, err)

					fixtures.JSONEqualOrderedBytes(t, test.JSONBytes(), jazon)
				})
			})
		})
	}
}


================================================
FILE: jsonutils/adapters/easyjson/json/doc.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

// Package json implements an [ifaces.Adapter] using [github.com/mailru/easyjson].
package json

import (
	_ "github.com/go-openapi/swag/jsonutils/adapters/ifaces" // for documentation purpose
)


================================================
FILE: jsonutils/adapters/easyjson/json/options.go
================================================
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
// SPDX-License-Identifier: Apache-2.0

package json

// Option selects options for the easyjson adapter.
type Option func(o *options)

type options struct {
	writerOptions
	lexerOptions
}

type lexerOptions struct {
	useMultipleErrors bool
}

type writerOptions struct {
	nilMapAsEmpty   bool
	nilSliceAsEmpty bool
	noEscapeHTML    bool
}

func WithLexerUseMultipleErrors(enabled bool) Option {
	return func(o *options) {
		o.useMultipleErrors = enabled
	}
}

func WithWriterNilMapAsEmpty(enabled bool) Option {
	return func(o *options) {
		o.nilMapAsEmpty = enabled
	}
}

func WithWriterNilSliceAsEmpty(enabled bool) Option {
	return func(o *options) {
		o.nilSliceAsEmpty = enabled
	}
}

fun
Download .txt
gitextract_9aq_6a1_/

├── .claude/
│   ├── .gitignore
│   ├── CLAUDE.md
│   └── rules/
│       ├── contributions.md
│       ├── github-workflows-conventions.md
│       ├── go-conventions.md
│       ├── linting.md
│       └── testing.md
├── .codecov.yml
├── .editorconfig
├── .gitattributes
├── .github/
│   ├── CONTRIBUTING.md
│   ├── DCO.md
│   ├── copilot-instructions.md
│   ├── dependabot.yaml
│   ├── wordlist.txt
│   └── workflows/
│       ├── auto-merge.yml
│       ├── bump-release.yml
│       ├── codeql.yml
│       ├── contributors.yml
│       ├── go-test.yml
│       ├── scanner.yml
│       └── tag-release.yml
├── .gitignore
├── .golangci.yml
├── .mockery.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTORS.md
├── LICENSE
├── README.md
├── SECURITY.md
├── cmdutils/
│   ├── cmd_utils.go
│   ├── doc.go
│   ├── go.mod
│   └── go.sum
├── cmdutils_iface.go
├── cmdutils_iface_test.go
├── conv/
│   ├── convert.go
│   ├── convert_format_test.go
│   ├── convert_types.go
│   ├── convert_types_test.go
│   ├── doc.go
│   ├── format.go
│   ├── go.mod
│   ├── go.sum
│   ├── sizeof.go
│   └── type_constraints.go
├── conv_iface.go
├── conv_iface_test.go
├── doc.go
├── docs/
│   ├── MAINTAINERS.md
│   ├── NOTES.md
│   ├── STYLE.md
│   └── TODOS.md
├── fileutils/
│   ├── doc.go
│   ├── file.go
│   ├── file_test.go
│   ├── go.mod
│   ├── go.sum
│   ├── path.go
│   └── path_test.go
├── fileutils_iface.go
├── fileutils_iface_test.go
├── go.mod
├── go.sum
├── go.work
├── go.work.sum
├── hack/
│   └── .gitkeep
├── jsonname/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── go_name_provider.go
│   ├── go_name_provider_test.go
│   ├── ifaces.go
│   ├── name_provider.go
│   └── name_provider_test.go
├── jsonname_iface.go
├── jsonname_iface_test.go
├── jsonutils/
│   ├── README.md
│   ├── adapters/
│   │   ├── doc.go
│   │   ├── easyjson/
│   │   │   ├── doc.go
│   │   │   ├── go.mod
│   │   │   ├── go.sum
│   │   │   └── json/
│   │   │       ├── adapter.go
│   │   │       ├── adapter_test.go
│   │   │       ├── doc.go
│   │   │       ├── options.go
│   │   │       ├── ordered_map.go
│   │   │       ├── ordered_map_test.go
│   │   │       ├── pool.go
│   │   │       └── register.go
│   │   ├── ifaces/
│   │   │   ├── doc.go
│   │   │   ├── ifaces.go
│   │   │   ├── mocks/
│   │   │   │   └── mocks.go
│   │   │   ├── registry_iface.go
│   │   │   └── registry_ifaces_test.go
│   │   ├── registry.go
│   │   ├── registry_test.go
│   │   ├── stdlib/
│   │   │   ├── doc.go
│   │   │   └── json/
│   │   │       ├── adapter.go
│   │   │       ├── adapter_test.go
│   │   │       ├── doc.go
│   │   │       ├── lexer.go
│   │   │       ├── lexer_test.go
│   │   │       ├── ordered_map.go
│   │   │       ├── ordered_map_test.go
│   │   │       ├── pool.go
│   │   │       ├── register.go
│   │   │       ├── writer.go
│   │   │       └── writer_test.go
│   │   └── testintegration/
│   │       ├── benchmarks/
│   │       │   ├── README.md
│   │       │   ├── benchmarks_test.go
│   │       │   ├── fixtures/
│   │       │   │   ├── large.json
│   │       │   │   ├── large_sample.json
│   │       │   │   ├── medium_sample.json
│   │       │   │   ├── small.json
│   │       │   │   ├── small_sample.json
│   │       │   │   └── tiny.json
│   │       │   ├── go.mod
│   │       │   ├── go.sum
│   │       │   ├── payloads.go
│   │       │   ├── payloads_easyjson.go
│   │       │   └── payloads_test.go
│   │       ├── doc.go
│   │       ├── go.mod
│   │       ├── go.sum
│   │       ├── ifaces.go
│   │       ├── integration_suite_test.go
│   │       ├── integration_test.go
│   │       └── mocks_test.go
│   ├── concat.go
│   ├── concat_test.go
│   ├── doc.go
│   ├── examples_test.go
│   ├── fixtures_test/
│   │   ├── doc.go
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── harness.go
│   │   ├── harness_test.go
│   │   └── ordered_fixtures.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── json.go
│   ├── json_test.go
│   ├── ordered_map.go
│   └── ordered_map_test.go
├── jsonutils_iface.go
├── jsonutils_iface_test.go
├── loading/
│   ├── doc.go
│   ├── errors.go
│   ├── fixtures/
│   │   ├── petstore_fixture.json
│   │   └── petstore_fixture.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── json.go
│   ├── json_test.go
│   ├── loading.go
│   ├── loading_test.go
│   ├── options.go
│   ├── serve_test.go
│   ├── yaml.go
│   └── yaml_test.go
├── loading_iface.go
├── loading_iface_test.go
├── mangling/
│   ├── BENCHMARK.md
│   ├── doc.go
│   ├── fuzz_test.go
│   ├── go.mod
│   ├── go.sum
│   ├── initialism_index.go
│   ├── initialism_index_test.go
│   ├── name_lexem.go
│   ├── name_lexem_test.go
│   ├── name_mangler.go
│   ├── name_mangler_benchmark_test.go
│   ├── name_mangler_test.go
│   ├── options.go
│   ├── pools.go
│   ├── split.go
│   ├── split_test.go
│   ├── string_bytes.go
│   ├── testdata/
│   │   └── fuzz/
│   │       └── FuzzToGoName/
│   │           └── 3e4b026d1078ac6b
│   ├── util.go
│   └── util_test.go
├── mangling_iface.go
├── mangling_iface_test.go
├── netutils/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── net.go
│   └── net_test.go
├── netutils_iface.go
├── netutils_iface_test.go
├── stringutils/
│   ├── collection_formats.go
│   ├── collection_formats_test.go
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── strings.go
│   └── strings_test.go
├── stringutils_iface.go
├── stringutils_iface_test.go
├── typeutils/
│   ├── doc.go
│   ├── go.mod
│   ├── go.sum
│   ├── types.go
│   └── types_test.go
├── typeutils_iface.go
├── typeutils_iface_test.go
├── yamlutils/
│   ├── doc.go
│   ├── errors.go
│   ├── examples_test.go
│   ├── fixtures/
│   │   ├── fixture_2224.yaml
│   │   ├── fixture_spec_tags.yaml
│   │   ├── fixture_with_quoted.yaml
│   │   └── fixture_with_ykey.yaml
│   ├── go.mod
│   ├── go.sum
│   ├── ordered_map.go
│   ├── ordered_map_test.go
│   ├── yaml.go
│   └── yaml_test.go
├── yamlutils_iface.go
└── yamlutils_iface_test.go
Download .txt
SYMBOL INDEX (940 symbols across 115 files)

FILE: cmdutils/cmd_utils.go
  type CommandLineOptionsGroup (line 9) | type CommandLineOptionsGroup struct

FILE: conv/convert.go
  constant maxJSONFloat (line 14) | maxJSONFloat         = float64(1<<53 - 1)
  constant minJSONFloat (line 15) | minJSONFloat         = -float64(1<<53 - 1)
  constant epsilon (line 16) | epsilon      float64 = 1e-9
  function IsFloat64AJSONInteger (line 20) | func IsFloat64AJSONInteger(f float64) bool {
  function ConvertFloat (line 42) | func ConvertFloat[T Float](str string) (T, error) {
  function ConvertInteger (line 53) | func ConvertInteger[T Signed](str string) (T, error) {
  function ConvertUinteger (line 64) | func ConvertUinteger[T Unsigned](str string) (T, error) {
  function ConvertBool (line 81) | func ConvertBool(str string) (bool, error) {
  function ConvertFloat32 (line 100) | func ConvertFloat32(str string) (float32, error) { return ConvertFloat[f...
  function ConvertFloat64 (line 103) | func ConvertFloat64(str string) (float64, error) { return ConvertFloat[f...
  function ConvertInt8 (line 106) | func ConvertInt8(str string) (int8, error) { return ConvertInteger[int8]...
  function ConvertInt16 (line 109) | func ConvertInt16(str string) (int16, error) {
  function ConvertInt32 (line 118) | func ConvertInt32(str string) (int32, error) {
  function ConvertInt64 (line 127) | func ConvertInt64(str string) (int64, error) {
  function ConvertUint8 (line 132) | func ConvertUint8(str string) (uint8, error) {
  function ConvertUint16 (line 141) | func ConvertUint16(str string) (uint16, error) {
  function ConvertUint32 (line 150) | func ConvertUint32(str string) (uint32, error) {
  function ConvertUint64 (line 159) | func ConvertUint64(str string) (uint64, error) {

FILE: conv/convert_format_test.go
  function TestConvertBool (line 34) | func TestConvertBool(t *testing.T) {
  function TestFormatBool (line 47) | func TestFormatBool(t *testing.T) {
  function TestConvertFloat (line 52) | func TestConvertFloat(t *testing.T) {
  function TestConvertInteger (line 102) | func TestConvertInteger(t *testing.T) {
  function TestConvertUinteger (line 200) | func TestConvertUinteger(t *testing.T) {
  function TestIsFloat64AJSONInteger (line 297) | func TestIsFloat64AJSONInteger(t *testing.T) {
  function TestPreviousIsFloat64AJSONInteger (line 302) | func TestPreviousIsFloat64AJSONInteger(t *testing.T) {
  function TestBitWiseIsFloat64AJSONInteger (line 307) | func TestBitWiseIsFloat64AJSONInteger(t *testing.T) {
  function TestBitWise2IsFloat64AJSONInteger (line 312) | func TestBitWise2IsFloat64AJSONInteger(t *testing.T) {
  function TestStdlib2IsFloat64AJSONInteger (line 317) | func TestStdlib2IsFloat64AJSONInteger(t *testing.T) {
  function testNotIntegers (line 322) | func testNotIntegers(fn func(float64) bool, skipKnownFailure bool) func(...
  function testIntegers (line 338) | func testIntegers(fn func(float64) bool, skipKnownFailure bool) func(*te...
  function BenchmarkIsFloat64JSONInteger (line 358) | func BenchmarkIsFloat64JSONInteger(b *testing.B) {
  function BenchmarkBitwise (line 370) | func BenchmarkBitwise(b *testing.B) {
  function previousIsFloat64JSONInteger (line 378) | func previousIsFloat64JSONInteger(f float64) bool {
  function stdlibIsFloat64JSONInteger (line 401) | func stdlibIsFloat64JSONInteger(f float64) bool {
  function bitwiseIsFloat64JSONInteger (line 411) | func bitwiseIsFloat64JSONInteger(f float64) bool {
  function bitwiseIsFloat64JSONInteger2 (line 429) | func bitwiseIsFloat64JSONInteger2(f float64) bool {
  constant mask (line 501) | mask  = 0x7FF
  constant shift (line 502) | shift = 64 - 11 - 1
  constant bias (line 505) | bias     = 1023
  constant fracMask (line 506) | fracMask = 1<<shift - 1
  function benchmarkIsFloat64JSONInteger (line 539) | func benchmarkIsFloat64JSONInteger(fn func(float64) bool) func(*testing....
  function testErrMsg (line 598) | func testErrMsg(f string) string {
  function uint64OverflowStr (line 607) | func uint64OverflowStr() string {
  function float64OverflowStr (line 616) | func float64OverflowStr() string {
  function BenchmarkConvertBool (line 626) | func BenchmarkConvertBool(b *testing.B) {

FILE: conv/convert_types.go
  function Pointer (line 13) | func Pointer[T any](v T) *T {
  function Value (line 20) | func Value[T any](v *T) T {
  function PointerSlice (line 30) | func PointerSlice[T any](src []T) []*T {
  function ValueSlice (line 41) | func ValueSlice[T any](src []*T) []T {
  function PointerMap (line 52) | func PointerMap[K comparable, T any](src map[K]T) map[K]*T {
  function ValueMap (line 64) | func ValueMap[K comparable, T any](src map[K]*T) map[K]T {

FILE: conv/convert_types_test.go
  constant wantsPointer (line 16) | wantsPointer = true
  constant wantsValue (line 17) | wantsValue   = false
  function TestSlice (line 20) | func TestSlice(t *testing.T) {
  function TestMap (line 63) | func TestMap(t *testing.T) {
  function TestPointer (line 105) | func TestPointer(t *testing.T) {
  function assertSingleValue (line 133) | func assertSingleValue(t *testing.T, inElem, elem reflect.Value, expectP...
  function assertValues (line 165) | func assertValues(t *testing.T, in, out any, expectPointer bool, idx int) {

FILE: conv/format.go
  function FormatInteger (line 11) | func FormatInteger[T Signed](value T) string {
  function FormatUinteger (line 16) | func FormatUinteger[T Unsigned](value T) string {
  function FormatFloat (line 21) | func FormatFloat[T Float](value T) string {
  function FormatBool (line 26) | func FormatBool(value bool) string {

FILE: conv/sizeof.go
  function bitsize (line 17) | func bitsize[T Numerical](value T) int {

FILE: conv/type_constraints.go
  type Signed (line 11) | type Signed interface
  type Unsigned (line 16) | type Unsigned interface
  type Float (line 21) | type Float interface
  type Numerical (line 26) | type Numerical interface

FILE: conv_iface.go
  function IsFloat64AJSONInteger (line 15) | func IsFloat64AJSONInteger(f float64) bool { return conv.IsFloat64AJSONI...
  function ConvertBool (line 20) | func ConvertBool(str string) (bool, error) { return conv.ConvertBool(str) }
  function ConvertFloat32 (line 25) | func ConvertFloat32(str string) (float32, error) { return conv.ConvertFl...
  function ConvertFloat64 (line 30) | func ConvertFloat64(str string) (float64, error) { return conv.ConvertFl...
  function ConvertInt8 (line 35) | func ConvertInt8(str string) (int8, error) { return conv.ConvertInteger[...
  function ConvertInt16 (line 40) | func ConvertInt16(str string) (int16, error) { return conv.ConvertIntege...
  function ConvertInt32 (line 45) | func ConvertInt32(str string) (int32, error) { return conv.ConvertIntege...
  function ConvertInt64 (line 50) | func ConvertInt64(str string) (int64, error) { return conv.ConvertIntege...
  function ConvertUint8 (line 55) | func ConvertUint8(str string) (uint8, error) { return conv.ConvertUinteg...
  function ConvertUint16 (line 60) | func ConvertUint16(str string) (uint16, error) { return conv.ConvertUint...
  function ConvertUint32 (line 65) | func ConvertUint32(str string) (uint32, error) { return conv.ConvertUint...
  function ConvertUint64 (line 70) | func ConvertUint64(str string) (uint64, error) { return conv.ConvertUint...
  function FormatBool (line 75) | func FormatBool(value bool) string { return conv.FormatBool(value) }
  function FormatFloat32 (line 80) | func FormatFloat32(value float32) string { return conv.FormatFloat(value) }
  function FormatFloat64 (line 85) | func FormatFloat64(value float64) string { return conv.FormatFloat(value) }
  function FormatInt8 (line 90) | func FormatInt8(value int8) string { return conv.FormatInteger(value) }
  function FormatInt16 (line 95) | func FormatInt16(value int16) string { return conv.FormatInteger(value) }
  function FormatInt32 (line 100) | func FormatInt32(value int32) string { return conv.FormatInteger(value) }
  function FormatInt64 (line 105) | func FormatInt64(value int64) string { return conv.FormatInteger(value) }
  function FormatUint8 (line 110) | func FormatUint8(value uint8) string { return conv.FormatUinteger(value) }
  function FormatUint16 (line 115) | func FormatUint16(value uint16) string { return conv.FormatUinteger(valu...
  function FormatUint32 (line 120) | func FormatUint32(value uint32) string { return conv.FormatUinteger(valu...
  function FormatUint64 (line 125) | func FormatUint64(value uint64) string { return conv.FormatUinteger(valu...
  function String (line 130) | func String(v string) *string { return conv.Pointer(v) }
  function StringValue (line 136) | func StringValue(v *string) string { return conv.Value(v) }
  function StringSlice (line 141) | func StringSlice(src []string) []*string { return conv.PointerSlice(src) }
  function StringValueSlice (line 146) | func StringValueSlice(src []*string) []string { return conv.ValueSlice(s...
  function StringMap (line 151) | func StringMap(src map[string]string) map[string]*string { return conv.P...
  function StringValueMap (line 156) | func StringValueMap(src map[string]*string) map[string]string { return c...
  function Bool (line 161) | func Bool(v bool) *bool { return conv.Pointer(v) }
  function BoolValue (line 166) | func BoolValue(v *bool) bool { return conv.Value(v) }
  function BoolSlice (line 171) | func BoolSlice(src []bool) []*bool { return conv.PointerSlice(src) }
  function BoolValueSlice (line 176) | func BoolValueSlice(src []*bool) []bool { return conv.ValueSlice(src) }
  function BoolMap (line 181) | func BoolMap(src map[string]bool) map[string]*bool { return conv.Pointer...
  function BoolValueMap (line 186) | func BoolValueMap(src map[string]*bool) map[string]bool { return conv.Va...
  function Int (line 191) | func Int(v int) *int { return conv.Pointer(v) }
  function IntValue (line 196) | func IntValue(v *int) int { return conv.Value(v) }
  function IntSlice (line 201) | func IntSlice(src []int) []*int { return conv.PointerSlice(src) }
  function IntValueSlice (line 206) | func IntValueSlice(src []*int) []int { return conv.ValueSlice(src) }
  function IntMap (line 211) | func IntMap(src map[string]int) map[string]*int { return conv.PointerMap...
  function IntValueMap (line 216) | func IntValueMap(src map[string]*int) map[string]int { return conv.Value...
  function Int32 (line 221) | func Int32(v int32) *int32 { return conv.Pointer(v) }
  function Int32Value (line 226) | func Int32Value(v *int32) int32 { return conv.Value(v) }
  function Int32Slice (line 231) | func Int32Slice(src []int32) []*int32 { return conv.PointerSlice(src) }
  function Int32ValueSlice (line 236) | func Int32ValueSlice(src []*int32) []int32 { return conv.ValueSlice(src) }
  function Int32Map (line 241) | func Int32Map(src map[string]int32) map[string]*int32 { return conv.Poin...
  function Int32ValueMap (line 246) | func Int32ValueMap(src map[string]*int32) map[string]int32 { return conv...
  function Int64 (line 251) | func Int64(v int64) *int64 { return conv.Pointer(v) }
  function Int64Value (line 256) | func Int64Value(v *int64) int64 { return conv.Value(v) }
  function Int64Slice (line 261) | func Int64Slice(src []int64) []*int64 { return conv.PointerSlice(src) }
  function Int64ValueSlice (line 266) | func Int64ValueSlice(src []*int64) []int64 { return conv.ValueSlice(src) }
  function Int64Map (line 271) | func Int64Map(src map[string]int64) map[string]*int64 { return conv.Poin...
  function Int64ValueMap (line 276) | func Int64ValueMap(src map[string]*int64) map[string]int64 { return conv...
  function Uint16 (line 281) | func Uint16(v uint16) *uint16 { return conv.Pointer(v) }
  function Uint16Value (line 286) | func Uint16Value(v *uint16) uint16 { return conv.Value(v) }
  function Uint16Slice (line 291) | func Uint16Slice(src []uint16) []*uint16 { return conv.PointerSlice(src) }
  function Uint16ValueSlice (line 296) | func Uint16ValueSlice(src []*uint16) []uint16 { return conv.ValueSlice(s...
  function Uint16Map (line 301) | func Uint16Map(src map[string]uint16) map[string]*uint16 { return conv.P...
  function Uint16ValueMap (line 306) | func Uint16ValueMap(src map[string]*uint16) map[string]uint16 { return c...
  function Uint (line 311) | func Uint(v uint) *uint { return conv.Pointer(v) }
  function UintValue (line 316) | func UintValue(v *uint) uint { return conv.Value(v) }
  function UintSlice (line 321) | func UintSlice(src []uint) []*uint { return conv.PointerSlice(src) }
  function UintValueSlice (line 326) | func UintValueSlice(src []*uint) []uint { return conv.ValueSlice(src) }
  function UintMap (line 331) | func UintMap(src map[string]uint) map[string]*uint { return conv.Pointer...
  function UintValueMap (line 336) | func UintValueMap(src map[string]*uint) map[string]uint { return conv.Va...
  function Uint32 (line 341) | func Uint32(v uint32) *uint32 { return conv.Pointer(v) }
  function Uint32Value (line 346) | func Uint32Value(v *uint32) uint32 { return conv.Value(v) }
  function Uint32Slice (line 351) | func Uint32Slice(src []uint32) []*uint32 { return conv.PointerSlice(src) }
  function Uint32ValueSlice (line 356) | func Uint32ValueSlice(src []*uint32) []uint32 { return conv.ValueSlice(s...
  function Uint32Map (line 361) | func Uint32Map(src map[string]uint32) map[string]*uint32 { return conv.P...
  function Uint32ValueMap (line 366) | func Uint32ValueMap(src map[string]*uint32) map[string]uint32 { return c...
  function Uint64 (line 371) | func Uint64(v uint64) *uint64 { return conv.Pointer(v) }
  function Uint64Value (line 376) | func Uint64Value(v *uint64) uint64 { return conv.Value(v) }
  function Uint64Slice (line 381) | func Uint64Slice(src []uint64) []*uint64 { return conv.PointerSlice(src) }
  function Uint64ValueSlice (line 386) | func Uint64ValueSlice(src []*uint64) []uint64 { return conv.ValueSlice(s...
  function Uint64Map (line 391) | func Uint64Map(src map[string]uint64) map[string]*uint64 { return conv.P...
  function Uint64ValueMap (line 396) | func Uint64ValueMap(src map[string]*uint64) map[string]uint64 { return c...
  function Float32 (line 401) | func Float32(v float32) *float32 { return conv.Pointer(v) }
  function Float32Value (line 406) | func Float32Value(v *float32) float32 { return conv.Value(v) }
  function Float32Slice (line 411) | func Float32Slice(src []float32) []*float32 { return conv.PointerSlice(s...
  function Float32ValueSlice (line 416) | func Float32ValueSlice(src []*float32) []float32 { return conv.ValueSlic...
  function Float32Map (line 421) | func Float32Map(src map[string]float32) map[string]*float32 { return con...
  function Float32ValueMap (line 426) | func Float32ValueMap(src map[string]*float32) map[string]float32 { retur...
  function Float64 (line 431) | func Float64(v float64) *float64 { return conv.Pointer(v) }
  function Float64Value (line 436) | func Float64Value(v *float64) float64 { return conv.Value(v) }
  function Float64Slice (line 441) | func Float64Slice(src []float64) []*float64 { return conv.PointerSlice(s...
  function Float64ValueSlice (line 446) | func Float64ValueSlice(src []*float64) []float64 { return conv.ValueSlic...
  function Float64Map (line 451) | func Float64Map(src map[string]float64) map[string]*float64 { return con...
  function Float64ValueMap (line 456) | func Float64ValueMap(src map[string]*float64) map[string]float64 { retur...
  function Time (line 461) | func Time(v time.Time) *time.Time { return conv.Pointer(v) }
  function TimeValue (line 466) | func TimeValue(v *time.Time) time.Time { return conv.Value(v) }
  function TimeSlice (line 471) | func TimeSlice(src []time.Time) []*time.Time { return conv.PointerSlice(...
  function TimeValueSlice (line 476) | func TimeValueSlice(src []*time.Time) []time.Time { return conv.ValueSli...
  function TimeMap (line 481) | func TimeMap(src map[string]time.Time) map[string]*time.Time { return co...
  function TimeValueMap (line 486) | func TimeValueMap(src map[string]*time.Time) map[string]time.Time { retu...

FILE: conv_iface_test.go
  function TestConvIface (line 14) | func TestConvIface(t *testing.T) {

FILE: fileutils/file.go
  type File (line 9) | type File struct
    method Read (line 15) | func (f *File) Read(p []byte) (n int, err error) {
    method Close (line 20) | func (f *File) Close() error {

FILE: fileutils/file_test.go
  function TestFileImplementsIOReader (line 13) | func TestFileImplementsIOReader(t *testing.T) {
  function TestFileImplementsIOReadCloser (line 19) | func TestFileImplementsIOReadCloser(t *testing.T) {

FILE: fileutils/path.go
  constant GOPATHKey (line 14) | GOPATHKey = "GOPATH"
  function FindInSearchPath (line 17) | func FindInSearchPath(searchPath, pkg string) string {
  function FindInGoSearchPath (line 33) | func FindInGoSearchPath(pkg string) string {
  function FullGoSearchPath (line 41) | func FullGoSearchPath() string {

FILE: fileutils/path_test.go
  function makeDirStructure (line 17) | func makeDirStructure(tb testing.TB, tgt string) (string, string) {
  function TestFindPackage (line 46) | func TestFindPackage(t *testing.T) {
  function assertPath (line 72) | func assertPath(t testing.TB, expected, actual string) bool {
  function TestFullGOPATH (line 79) | func TestFullGOPATH(t *testing.T) {

FILE: fileutils_iface.go
  constant GOPATHKey (line 11) | GOPATHKey = fileutils.GOPATHKey
  function FindInSearchPath (line 21) | func FindInSearchPath(searchPath, pkg string) string {
  function FindInGoSearchPath (line 28) | func FindInGoSearchPath(pkg string) string { return fileutils.FindInGoSe...
  function FullGoSearchPath (line 33) | func FullGoSearchPath() string { return fileutils.FullGoSearchPath() }

FILE: fileutils_iface_test.go
  function TestFileUtilsIface (line 15) | func TestFileUtilsIface(t *testing.T) {

FILE: jsonname/go_name_provider.go
  type GoNameProvider (line 32) | type GoNameProvider struct
    method GetJSONNames (line 45) | func (n *GoNameProvider) GetJSONNames(subject any) []string {
    method GetJSONName (line 61) | func (n *GoNameProvider) GetJSONName(subject any, name string) (string...
    method GetJSONNameForType (line 68) | func (n *GoNameProvider) GetJSONNameForType(tpe reflect.Type, name str...
    method GetGoName (line 79) | func (n *GoNameProvider) GetGoName(subject any, name string) (string, ...
    method GetGoNameForType (line 86) | func (n *GoNameProvider) GetGoNameForType(tpe reflect.Type, name strin...
    method nameIndexFor (line 96) | func (n *GoNameProvider) nameIndexFor(tpe reflect.Type) nameIndex {
  function NewGoNameProvider (line 38) | func NewGoNameProvider() *GoNameProvider {
  type fieldEntry (line 110) | type fieldEntry struct
  function buildGoNameIndex (line 117) | func buildGoNameIndex(tpe reflect.Type) nameIndex {
  function collectGoFields (line 132) | func collectGoFields(tpe reflect.Type) []fieldEntry {
  function dominantFields (line 227) | func dominantFields(candidates []fieldEntry) []fieldEntry {
  function parseJSONTag (line 277) | func parseJSONTag(tag string) (string, string) {

FILE: jsonname/go_name_provider_test.go
  type testAltEmbedded (line 16) | type testAltEmbedded struct
  type testAltDeep (line 20) | type testAltDeep struct
  type testAltMiddle (line 24) | type testAltMiddle struct
  type testAltStruct (line 41) | type testAltStruct struct
  type testAltShadow (line 57) | type testAltShadow struct
  function TestGoNameProvider (line 63) | func TestGoNameProvider(t *testing.T) {
  function TestGoNameProvider_ShadowingMatchesStdlib (line 170) | func TestGoNameProvider_ShadowingMatchesStdlib(t *testing.T) {
  function TestGoNameProvider_ImplementsInterface (line 190) | func TestGoNameProvider_ImplementsInterface(t *testing.T) {
  type testAltInner (line 198) | type testAltInner struct
  type testAltPromoted (line 203) | type testAltPromoted struct
  type testAltTaggedEmbed (line 209) | type testAltTaggedEmbed struct
  type testAltPtrEmbed (line 215) | type testAltPtrEmbed struct
  type testAltUnexportedEmbed (line 221) | type testAltUnexportedEmbed struct
  function TestGoNameProvider_EmbeddedPromotion (line 229) | func TestGoNameProvider_EmbeddedPromotion(t *testing.T) {

FILE: jsonname/ifaces.go
  type providerIface (line 11) | type providerIface interface

FILE: jsonname/name_provider.go
  type NameProvider (line 23) | type NameProvider struct
    method GetJSONNames (line 84) | func (n *NameProvider) GetJSONNames(subject any) []string {
    method GetJSONName (line 101) | func (n *NameProvider) GetJSONName(subject any, name string) (string, ...
    method GetJSONNameForType (line 107) | func (n *NameProvider) GetJSONNameForType(tpe reflect.Type, name strin...
    method GetGoName (line 119) | func (n *NameProvider) GetGoName(subject any, name string) (string, bo...
    method GetGoNameForType (line 125) | func (n *NameProvider) GetGoNameForType(tpe reflect.Type, name string)...
    method makeNameIndex (line 136) | func (n *NameProvider) makeNameIndex(tpe reflect.Type) nameIndex {
  type nameIndex (line 28) | type nameIndex struct
  function NewNameProvider (line 34) | func NewNameProvider() *NameProvider {
  function buildnameIndex (line 41) | func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
  function newNameIndex (line 75) | func newNameIndex(tpe reflect.Type) nameIndex {

FILE: jsonname/name_provider_test.go
  type testNameStruct (line 13) | type testNameStruct struct
  function TestNameProvider (line 19) | func TestNameProvider(t *testing.T) {

FILE: jsonname_iface.go
  function NewNameProvider (line 24) | func NewNameProvider() *NameProvider { return jsonname.NewNameProvider() }

FILE: jsonname_iface_test.go
  function TestJSONNameIface (line 12) | func TestJSONNameIface(t *testing.T) {

FILE: jsonutils/adapters/easyjson/json/adapter.go
  type Adapter (line 18) | type Adapter struct
    method Marshal (line 33) | func (a *Adapter) Marshal(value any) ([]byte, error) {
    method Unmarshal (line 57) | func (a *Adapter) Unmarshal(data []byte, value any) error {
    method OrderedMarshal (line 73) | func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) {
    method OrderedUnmarshal (line 112) | func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdere...
    method NewOrderedMap (line 130) | func (a *Adapter) NewOrderedMap(capacity int) ifaces.OrderedMap {
    method Redeem (line 136) | func (a *Adapter) Redeem() {
    method Reset (line 143) | func (a *Adapter) Reset() {
  function NewAdapter (line 23) | func NewAdapter(opts ...Option) *Adapter {
  function newJWriter (line 147) | func newJWriter() *jwriter.Writer {
  function newJLexer (line 153) | func newJLexer() *jlexer.Lexer {

FILE: jsonutils/adapters/easyjson/json/adapter_test.go
  function TestAdapter (line 14) | func TestAdapter(t *testing.T) {

FILE: jsonutils/adapters/easyjson/json/options.go
  type Option (line 7) | type Option
  type options (line 9) | type options struct
  type lexerOptions (line 14) | type lexerOptions struct
  type writerOptions (line 18) | type writerOptions struct
  function WithLexerUseMultipleErrors (line 24) | func WithLexerUseMultipleErrors(enabled bool) Option {
  function WithWriterNilMapAsEmpty (line 30) | func WithWriterNilMapAsEmpty(enabled bool) Option {
  function WithWriterNilSliceAsEmpty (line 36) | func WithWriterNilSliceAsEmpty(enabled bool) Option {
  function WithWriterNoEscapeHTML (line 42) | func WithWriterNoEscapeHTML(noescape bool) Option {

FILE: jsonutils/adapters/easyjson/json/ordered_map.go
  type MapSlice (line 25) | type MapSlice
    method OrderedItems (line 27) | func (s MapSlice) OrderedItems() iter.Seq2[string, any] {
    method SetOrderedItems (line 37) | func (s *MapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
    method MarshalJSON (line 77) | func (s MapSlice) MarshalJSON() ([]byte, error) {
    method OrderedMarshalJSON (line 81) | func (s MapSlice) OrderedMarshalJSON() ([]byte, error) {
    method MarshalEasyJSON (line 93) | func (s MapSlice) MarshalEasyJSON(w *jwriter.Writer) {
    method UnmarshalJSON (line 121) | func (s *MapSlice) UnmarshalJSON(data []byte) error {
    method OrderedUnmarshalJSON (line 125) | func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error {
    method UnmarshalEasyJSON (line 137) | func (s *MapSlice) UnmarshalEasyJSON(in *jlexer.Lexer) {
  type MapItem (line 160) | type MapItem struct
    method MarshalEasyJSON (line 166) | func (s MapItem) MarshalEasyJSON(w *jwriter.Writer) {
    method UnmarshalEasyJSON (line 179) | func (s *MapItem) UnmarshalEasyJSON(in *jlexer.Lexer) {
    method asInterface (line 194) | func (s *MapItem) asInterface(in *jlexer.Lexer) any {

FILE: jsonutils/adapters/easyjson/json/ordered_map_test.go
  function TestSetOrdered (line 13) | func TestSetOrdered(t *testing.T) {

FILE: jsonutils/adapters/easyjson/json/pool.go
  type adaptersPool (line 15) | type adaptersPool struct
    method Borrow (line 19) | func (p *adaptersPool) Borrow() *Adapter {
    method BorrowIface (line 23) | func (p *adaptersPool) BorrowIface() ifaces.Adapter {
    method Redeem (line 27) | func (p *adaptersPool) Redeem(a *Adapter) {
  type writersPool (line 31) | type writersPool struct
    method Borrow (line 35) | func (p *writersPool) Borrow() *jwriter.Writer {
    method Redeem (line 47) | func (p *writersPool) Redeem(w *jwriter.Writer) {
  type lexersPool (line 51) | type lexersPool struct
    method Borrow (line 57) | func (p *lexersPool) Borrow(data []byte) *jlexer.Lexer {
    method Redeem (line 67) | func (p *lexersPool) Redeem(l *jlexer.Lexer) {
  function BorrowAdapter (line 98) | func BorrowAdapter() *Adapter {
  function BorrowAdapterIface (line 102) | func BorrowAdapterIface() ifaces.Adapter {
  function RedeemAdapter (line 107) | func RedeemAdapter(a *Adapter) {
  function RedeemAdapterIface (line 111) | func RedeemAdapterIface(a ifaces.Adapter) {
  function BorrowWriter (line 119) | func BorrowWriter() *jwriter.Writer {
  function RedeemWriter (line 124) | func RedeemWriter(w *jwriter.Writer) {
  function BorrowLexer (line 129) | func BorrowLexer(data []byte) *jlexer.Lexer {
  function RedeemLexer (line 134) | func RedeemLexer(l *jlexer.Lexer) {

FILE: jsonutils/adapters/easyjson/json/register.go
  function Register (line 20) | func Register(dispatcher ifaces.Registrar, opts ...Option) {
  function support (line 36) | func support(capability ifaces.Capability, value any) bool {

FILE: jsonutils/adapters/ifaces/ifaces.go
  type Ordered (line 12) | type Ordered interface
  type SetOrdered (line 20) | type SetOrdered interface
  type OrderedMap (line 26) | type OrderedMap interface
  type MarshalAdapter (line 35) | type MarshalAdapter interface
  type OrderedMarshalAdapter (line 42) | type OrderedMarshalAdapter interface
  type UnmarshalAdapter (line 49) | type UnmarshalAdapter interface
  type OrderedUnmarshalAdapter (line 56) | type OrderedUnmarshalAdapter interface
  type Adapter (line 63) | type Adapter interface
  type OrderedAdapter (line 71) | type OrderedAdapter interface
  type Poolable (line 77) | type Poolable interface

FILE: jsonutils/adapters/ifaces/mocks/mocks.go
  type MockOrdered (line 36) | type MockOrdered struct
    method OrderedItems (line 50) | func (mock *MockOrdered) OrderedItems() iter.Seq2[string, any] {
    method OrderedItemsCalls (line 66) | func (mock *MockOrdered) OrderedItemsCalls() []struct {
  type MockSetOrdered (line 95) | type MockSetOrdered struct
    method SetOrderedItems (line 111) | func (mock *MockSetOrdered) SetOrderedItems(seq2 iter.Seq2[string, any...
    method SetOrderedItemsCalls (line 130) | func (mock *MockSetOrdered) SetOrderedItemsCalls() []struct {
  type MockOrderedMap (line 170) | type MockOrderedMap struct
    method OrderedItems (line 209) | func (mock *MockOrderedMap) OrderedItems() iter.Seq2[string, any] {
    method OrderedItemsCalls (line 225) | func (mock *MockOrderedMap) OrderedItemsCalls() []struct {
    method OrderedMarshalJSON (line 236) | func (mock *MockOrderedMap) OrderedMarshalJSON() ([]byte, error) {
    method OrderedMarshalJSONCalls (line 252) | func (mock *MockOrderedMap) OrderedMarshalJSONCalls() []struct {
    method OrderedUnmarshalJSON (line 263) | func (mock *MockOrderedMap) OrderedUnmarshalJSON(bytes []byte) error {
    method OrderedUnmarshalJSONCalls (line 282) | func (mock *MockOrderedMap) OrderedUnmarshalJSONCalls() []struct {
    method SetOrderedItems (line 295) | func (mock *MockOrderedMap) SetOrderedItems(seq2 iter.Seq2[string, any...
    method SetOrderedItemsCalls (line 314) | func (mock *MockOrderedMap) SetOrderedItemsCalls() []struct {
  type MockMarshalAdapter (line 351) | type MockMarshalAdapter struct
    method Marshal (line 381) | func (mock *MockMarshalAdapter) Marshal(v any) ([]byte, error) {
    method MarshalCalls (line 400) | func (mock *MockMarshalAdapter) MarshalCalls() []struct {
    method Redeem (line 413) | func (mock *MockMarshalAdapter) Redeem() {
    method RedeemCalls (line 429) | func (mock *MockMarshalAdapter) RedeemCalls() []struct {
    method Reset (line 440) | func (mock *MockMarshalAdapter) Reset() {
    method ResetCalls (line 456) | func (mock *MockMarshalAdapter) ResetCalls() []struct {
  type MockOrderedMarshalAdapter (line 491) | type MockOrderedMarshalAdapter struct
    method OrderedMarshal (line 521) | func (mock *MockOrderedMarshalAdapter) OrderedMarshal(ordered ifaces.O...
    method OrderedMarshalCalls (line 540) | func (mock *MockOrderedMarshalAdapter) OrderedMarshalCalls() []struct {
    method Redeem (line 553) | func (mock *MockOrderedMarshalAdapter) Redeem() {
    method RedeemCalls (line 569) | func (mock *MockOrderedMarshalAdapter) RedeemCalls() []struct {
    method Reset (line 580) | func (mock *MockOrderedMarshalAdapter) Reset() {
    method ResetCalls (line 596) | func (mock *MockOrderedMarshalAdapter) ResetCalls() []struct {
  type MockUnmarshalAdapter (line 631) | type MockUnmarshalAdapter struct
    method Redeem (line 663) | func (mock *MockUnmarshalAdapter) Redeem() {
    method RedeemCalls (line 679) | func (mock *MockUnmarshalAdapter) RedeemCalls() []struct {
    method Reset (line 690) | func (mock *MockUnmarshalAdapter) Reset() {
    method ResetCalls (line 706) | func (mock *MockUnmarshalAdapter) ResetCalls() []struct {
    method Unmarshal (line 717) | func (mock *MockUnmarshalAdapter) Unmarshal(bytes []byte, v any) error {
    method UnmarshalCalls (line 738) | func (mock *MockUnmarshalAdapter) UnmarshalCalls() []struct {
  type MockOrderedUnmarshalAdapter (line 777) | type MockOrderedUnmarshalAdapter struct
    method OrderedUnmarshal (line 809) | func (mock *MockOrderedUnmarshalAdapter) OrderedUnmarshal(bytes []byte...
    method OrderedUnmarshalCalls (line 830) | func (mock *MockOrderedUnmarshalAdapter) OrderedUnmarshalCalls() []str...
    method Redeem (line 845) | func (mock *MockOrderedUnmarshalAdapter) Redeem() {
    method RedeemCalls (line 861) | func (mock *MockOrderedUnmarshalAdapter) RedeemCalls() []struct {
    method Reset (line 872) | func (mock *MockOrderedUnmarshalAdapter) Reset() {
    method ResetCalls (line 888) | func (mock *MockOrderedUnmarshalAdapter) ResetCalls() []struct {
  type MockAdapter (line 935) | type MockAdapter struct
    method Marshal (line 1005) | func (mock *MockAdapter) Marshal(v any) ([]byte, error) {
    method MarshalCalls (line 1024) | func (mock *MockAdapter) MarshalCalls() []struct {
    method NewOrderedMap (line 1037) | func (mock *MockAdapter) NewOrderedMap(capacity int) ifaces.OrderedMap {
    method NewOrderedMapCalls (line 1056) | func (mock *MockAdapter) NewOrderedMapCalls() []struct {
    method OrderedMarshal (line 1069) | func (mock *MockAdapter) OrderedMarshal(ordered ifaces.Ordered) ([]byt...
    method OrderedMarshalCalls (line 1088) | func (mock *MockAdapter) OrderedMarshalCalls() []struct {
    method OrderedUnmarshal (line 1101) | func (mock *MockAdapter) OrderedUnmarshal(bytes []byte, setOrdered ifa...
    method OrderedUnmarshalCalls (line 1122) | func (mock *MockAdapter) OrderedUnmarshalCalls() []struct {
    method Redeem (line 1137) | func (mock *MockAdapter) Redeem() {
    method RedeemCalls (line 1153) | func (mock *MockAdapter) RedeemCalls() []struct {
    method Reset (line 1164) | func (mock *MockAdapter) Reset() {
    method ResetCalls (line 1180) | func (mock *MockAdapter) ResetCalls() []struct {
    method Unmarshal (line 1191) | func (mock *MockAdapter) Unmarshal(bytes []byte, v any) error {
    method UnmarshalCalls (line 1212) | func (mock *MockAdapter) UnmarshalCalls() []struct {
  type MockOrderedAdapter (line 1257) | type MockOrderedAdapter struct
    method NewOrderedMap (line 1307) | func (mock *MockOrderedAdapter) NewOrderedMap(capacity int) ifaces.Ord...
    method NewOrderedMapCalls (line 1326) | func (mock *MockOrderedAdapter) NewOrderedMapCalls() []struct {
    method OrderedMarshal (line 1339) | func (mock *MockOrderedAdapter) OrderedMarshal(ordered ifaces.Ordered)...
    method OrderedMarshalCalls (line 1358) | func (mock *MockOrderedAdapter) OrderedMarshalCalls() []struct {
    method OrderedUnmarshal (line 1371) | func (mock *MockOrderedAdapter) OrderedUnmarshal(bytes []byte, setOrde...
    method OrderedUnmarshalCalls (line 1392) | func (mock *MockOrderedAdapter) OrderedUnmarshalCalls() []struct {
    method Redeem (line 1407) | func (mock *MockOrderedAdapter) Redeem() {
    method RedeemCalls (line 1423) | func (mock *MockOrderedAdapter) RedeemCalls() []struct {
    method Reset (line 1434) | func (mock *MockOrderedAdapter) Reset() {
    method ResetCalls (line 1450) | func (mock *MockOrderedAdapter) ResetCalls() []struct {
  type MockPoolable (line 1482) | type MockPoolable struct
    method Redeem (line 1503) | func (mock *MockPoolable) Redeem() {
    method RedeemCalls (line 1519) | func (mock *MockPoolable) RedeemCalls() []struct {
    method Reset (line 1530) | func (mock *MockPoolable) Reset() {
    method ResetCalls (line 1546) | func (mock *MockPoolable) ResetCalls() []struct {
  type MockRegistrar (line 1575) | type MockRegistrar struct
    method RegisterFor (line 1591) | func (mock *MockRegistrar) RegisterFor(registryEntry ifaces.RegistryEn...
    method RegisterForCalls (line 1610) | func (mock *MockRegistrar) RegisterForCalls() []struct {

FILE: jsonutils/adapters/ifaces/registry_iface.go
  type Capability (line 11) | type Capability
    method String (line 21) | func (c Capability) String() string {
  constant CapabilityMarshalJSON (line 14) | CapabilityMarshalJSON Capability = 1 << iota
  constant CapabilityUnmarshalJSON (line 15) | CapabilityUnmarshalJSON
  constant CapabilityOrderedMarshalJSON (line 16) | CapabilityOrderedMarshalJSON
  constant CapabilityOrderedUnmarshalJSON (line 17) | CapabilityOrderedUnmarshalJSON
  constant CapabilityOrderedMap (line 18) | CapabilityOrderedMap
  type Capabilities (line 39) | type Capabilities
    method Has (line 42) | func (c Capabilities) Has(capability Capability) bool {
    method String (line 46) | func (c Capabilities) String() string {
  constant AllCapabilities (line 71) | AllCapabilities Capabilities = Capabilities(uint8(CapabilityMarshalJSON) |
  constant AllUnorderedCapabilities (line 77) | AllUnorderedCapabilities Capabilities = Capabilities(uint8(CapabilityMar...
  type RegistryEntry (line 81) | type RegistryEntry struct
  type Registrar (line 89) | type Registrar interface

FILE: jsonutils/adapters/ifaces/registry_ifaces_test.go
  function TestRegistryIfaces (line 12) | func TestRegistryIfaces(t *testing.T) {

FILE: jsonutils/adapters/registry.go
  type registryError (line 25) | type registryError
    method Error (line 27) | func (e registryError) Error() string {
  type registry (line 34) | type registry
  type Registrar (line 39) | type Registrar struct
    method ClearCache (line 77) | func (r *Registrar) ClearCache() {
    method Reset (line 84) | func (r *Registrar) Reset() {
    method RegisterFor (line 98) | func (r *Registrar) RegisterFor(entry ifaces.RegistryEntry) {
    method AdapterFor (line 132) | func (r *Registrar) AdapterFor(capability ifaces.Capability, value any...
    method clearCache (line 141) | func (r *Registrar) clearCache() {
    method findFirstFor (line 149) | func (r *Registrar) findFirstFor(capability ifaces.Capability, value a...
    method findFirstInRegistryFor (line 166) | func (r *Registrar) findFirstInRegistryFor(reg registry, cache map[ref...
  function NewRegistrar (line 56) | func NewRegistrar() *Registrar {
  function MarshalAdapterFor (line 198) | func MarshalAdapterFor(value any) ifaces.MarshalAdapter {
  function OrderedMarshalAdapterFor (line 203) | func OrderedMarshalAdapterFor(value ifaces.Ordered) ifaces.OrderedMarsha...
  function UnmarshalAdapterFor (line 208) | func UnmarshalAdapterFor(value any) ifaces.UnmarshalAdapter {
  function OrderedUnmarshalAdapterFor (line 213) | func OrderedUnmarshalAdapterFor(value ifaces.SetOrdered) ifaces.OrderedU...
  function NewOrderedMap (line 218) | func NewOrderedMap(capacity int) ifaces.OrderedMap {
  function noopRedeemer (line 229) | func noopRedeemer() {}

FILE: jsonutils/adapters/registry_test.go
  function TestRegistryUnmarshal (line 17) | func TestRegistryUnmarshal(t *testing.T) {
  function TestRegistryMarshal (line 94) | func TestRegistryMarshal(t *testing.T) {
  function TestRegistryOrderedMap (line 271) | func TestRegistryOrderedMap(t *testing.T) {
  function TestEmptyRegistry (line 313) | func TestEmptyRegistry(t *testing.T) {
  function TestGlobalRegistry (line 326) | func TestGlobalRegistry(t *testing.T) {
  function testUnmarshal (line 382) | func testUnmarshal[ValueType any, AdapterType ifaces.UnmarshalAdapter](r...
  function testMarshal (line 424) | func testMarshal[ValueType any, AdapterType ifaces.MarshalAdapter](reg *...
  type MockAdapter1 (line 464) | type MockAdapter1 struct
    method UnmarshalCallsLen (line 468) | func (a *MockAdapter1) UnmarshalCallsLen() int {
    method MarshalCallsLen (line 472) | func (a *MockAdapter1) MarshalCallsLen() int {
  type MockAdapter2 (line 476) | type MockAdapter2 struct
    method UnmarshalCallsLen (line 480) | func (a *MockAdapter2) UnmarshalCallsLen() int {
    method MarshalCallsLen (line 484) | func (a *MockAdapter2) MarshalCallsLen() int {
  function newMockAdapter1 (line 488) | func newMockAdapter1() *MockAdapter1 {
  function newMockAdapter2 (line 494) | func newMockAdapter2() *MockAdapter2 {
  function newMockAdapter (line 500) | func newMockAdapter() *mocks.MockAdapter {
  function support1 (line 521) | func support1(_ ifaces.Capability, _ any) bool {
  type supportedType (line 525) | type supportedType struct
  function support2 (line 528) | func support2(capability ifaces.Capability, value any) bool {
  function register1 (line 538) | func register1(dispatcher ifaces.Registrar) {
  function register2 (line 552) | func register2(dispatcher ifaces.Registrar) {
  type MockOrdered (line 568) | type MockOrdered struct
    method OrderedMarshalJSON (line 573) | func (m *MockOrdered) OrderedMarshalJSON() ([]byte, error) {
    method OrderedUnmarshalJSON (line 577) | func (m *MockOrdered) OrderedUnmarshalJSON([]byte) error {
  function newMockOrdered (line 581) | func newMockOrdered() *MockOrdered {

FILE: jsonutils/adapters/stdlib/json/adapter.go
  constant sensibleBufferSize (line 13) | sensibleBufferSize = 8192
  type jsonError (line 15) | type jsonError
    method Error (line 17) | func (e jsonError) Error() string {
  type Adapter (line 26) | type Adapter struct
    method Marshal (line 34) | func (a *Adapter) Marshal(value any) ([]byte, error) {
    method Unmarshal (line 38) | func (a *Adapter) Unmarshal(data []byte, value any) error {
    method OrderedMarshal (line 42) | func (a *Adapter) OrderedMarshal(value ifaces.Ordered) ([]byte, error) {
    method OrderedUnmarshal (line 79) | func (a *Adapter) OrderedUnmarshal(data []byte, value ifaces.SetOrdere...
    method NewOrderedMap (line 97) | func (a *Adapter) NewOrderedMap(capacity int) ifaces.OrderedMap {
    method Redeem (line 106) | func (a *Adapter) Redeem() {
    method Reset (line 114) | func (a *Adapter) Reset() {
  function NewAdapter (line 30) | func NewAdapter() *Adapter {

FILE: jsonutils/adapters/stdlib/json/adapter_test.go
  function TestAdapter (line 14) | func TestAdapter(t *testing.T) {

FILE: jsonutils/adapters/stdlib/json/lexer.go
  type token (line 17) | type token struct
    method String (line 21) | func (t token) String() string {
    method Kind (line 32) | func (t token) Kind() tokenKind {
    method Delim (line 51) | func (t token) Delim() byte {
  type tokenKind (line 60) | type tokenKind
  constant tokenUndef (line 63) | tokenUndef tokenKind = iota
  constant tokenString (line 64) | tokenString
  constant tokenNumber (line 65) | tokenNumber
  constant tokenFloat (line 66) | tokenFloat
  constant tokenBool (line 67) | tokenBool
  constant tokenNull (line 68) | tokenNull
  constant tokenDelim (line 69) | tokenDelim
  type jlexer (line 87) | type jlexer struct
    method Reset (line 143) | func (l *jlexer) Reset() {
    method Error (line 149) | func (l *jlexer) Error() error {
    method SetErr (line 153) | func (l *jlexer) SetErr(err error) {
    method Ok (line 157) | func (l *jlexer) Ok() bool {
    method NextToken (line 162) | func (l *jlexer) NextToken() token {
    method PeekToken (line 178) | func (l *jlexer) PeekToken() token {
    method Skip (line 186) | func (l *jlexer) Skip() {
    method IsDelim (line 190) | func (l *jlexer) IsDelim(c byte) bool {
    method IsNull (line 207) | func (l *jlexer) IsNull() bool {
    method Delim (line 217) | func (l *jlexer) Delim(c byte) {
    method Null (line 234) | func (l *jlexer) Null() {
    method Number (line 245) | func (l *jlexer) Number() any {
    method Bool (line 277) | func (l *jlexer) Bool() bool {
    method String (line 292) | func (l *jlexer) String() string {
    method fetchToken (line 308) | func (l *jlexer) fetchToken() token {
  type bytesReader (line 96) | type bytesReader struct
    method Reset (line 101) | func (b *bytesReader) Reset() {
    method Read (line 106) | func (b *bytesReader) Read(p []byte) (int, error) {
  function newLexer (line 130) | func newLexer(data []byte) *jlexer {

FILE: jsonutils/adapters/stdlib/json/lexer_test.go
  function TestToken (line 15) | func TestToken(t *testing.T) {
  function TestBytesReader (line 39) | func TestBytesReader(t *testing.T) {
  function TestLexer (line 95) | func TestLexer(t *testing.T) {

FILE: jsonutils/adapters/stdlib/json/ordered_map.go
  type MapSlice (line 17) | type MapSlice
    method OrderedItems (line 19) | func (s MapSlice) OrderedItems() iter.Seq2[string, any] {
    method SetOrderedItems (line 29) | func (s *MapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
    method MarshalJSON (line 68) | func (s MapSlice) MarshalJSON() ([]byte, error) {
    method OrderedMarshalJSON (line 72) | func (s MapSlice) OrderedMarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 86) | func (s *MapSlice) UnmarshalJSON(data []byte) error {
    method OrderedUnmarshalJSON (line 90) | func (s *MapSlice) OrderedUnmarshalJSON(data []byte) error {
    method marshalObject (line 101) | func (s MapSlice) marshalObject(w *jwriter) {
    method unmarshalObject (line 126) | func (s *MapSlice) unmarshalObject(in *jlexer) {
  type MapItem (line 160) | type MapItem struct
    method marshalJSON (line 165) | func (s MapItem) marshalJSON(w *jwriter) {
    method unmarshalKeyValue (line 171) | func (s *MapItem) unmarshalKeyValue(in *jlexer) {
    method unmarshalArray (line 183) | func (s *MapItem) unmarshalArray(in *jlexer) []any {
    method asInterface (line 214) | func (s *MapItem) asInterface(in *jlexer) any {

FILE: jsonutils/adapters/stdlib/json/ordered_map_test.go
  function TestSetOrdered (line 19) | func TestSetOrdered(t *testing.T) {
  function TestMapSlice (line 57) | func TestMapSlice(t *testing.T) {
  function TestLexerErrors (line 103) | func TestLexerErrors(t *testing.T) {
  function TestReproDataRace (line 124) | func TestReproDataRace(t *testing.T) {

FILE: jsonutils/adapters/stdlib/json/pool.go
  type adaptersPool (line 13) | type adaptersPool struct
    method Borrow (line 17) | func (p *adaptersPool) Borrow() *Adapter {
    method BorrowIface (line 21) | func (p *adaptersPool) BorrowIface() ifaces.Adapter {
    method Redeem (line 25) | func (p *adaptersPool) Redeem(a *Adapter) {
  type writersPool (line 29) | type writersPool struct
    method Borrow (line 33) | func (p *writersPool) Borrow() *jwriter {
    method Redeem (line 42) | func (p *writersPool) Redeem(w *jwriter) {
  type lexersPool (line 46) | type lexersPool struct
    method Borrow (line 50) | func (p *lexersPool) Borrow(data []byte) *jlexer {
    method Redeem (line 61) | func (p *lexersPool) Redeem(l *jlexer) {
  type readersPool (line 69) | type readersPool struct
    method Borrow (line 73) | func (p *readersPool) Borrow(data []byte) *bytesReader {
    method Redeem (line 83) | func (p *readersPool) Redeem(b *bytesReader) {
  function BorrowAdapter (line 122) | func BorrowAdapter() *Adapter {
  function BorrowAdapterIface (line 129) | func BorrowAdapterIface() ifaces.Adapter {
  function RedeemAdapter (line 134) | func RedeemAdapter(a *Adapter) {
  function RedeemAdapterIface (line 138) | func RedeemAdapterIface(a ifaces.Adapter) {

FILE: jsonutils/adapters/stdlib/json/register.go
  function Register (line 13) | func Register(dispatcher ifaces.Registrar) {
  function support (line 24) | func support(_ ifaces.Capability, _ any) bool {

FILE: jsonutils/adapters/stdlib/json/writer.go
  type jwriter (line 12) | type jwriter struct
    method Reset (line 23) | func (w *jwriter) Reset() {
    method RawString (line 28) | func (w *jwriter) RawString(s string) {
    method Raw (line 35) | func (w *jwriter) Raw(b []byte, err error) {
    method RawByte (line 47) | func (w *jwriter) RawByte(c byte) {
    method String (line 56) | func (w *jwriter) String(s string) {
    method BuildBytes (line 69) | func (w *jwriter) BuildBytes() ([]byte, error) {
  function newJWriter (line 17) | func newJWriter() *jwriter {

FILE: jsonutils/adapters/stdlib/json/writer_test.go
  function TestWriter (line 12) | func TestWriter(t *testing.T) {

FILE: jsonutils/adapters/testintegration/benchmarks/benchmarks_test.go
  type benchmarkContext (line 25) | type benchmarkContext struct
    method Small (line 31) | func (c *benchmarkContext) Small() *SmallPayload {
    method Medium (line 34) | func (c *benchmarkContext) Medium() *MediumPayload {
    method Large (line 37) | func (c *benchmarkContext) Large() *LargePayload {
  function BenchmarkJSON (line 41) | func BenchmarkJSON(b *testing.B) {
  function initBenchmarks (line 56) | func initBenchmarks(b *testing.B) *benchmarkContext {
  function allBenchs (line 68) | func allBenchs(ctx *benchmarkContext, library string) func(*testing.B) {
  function benchRead (line 82) | func benchRead[T any](jazon []byte) func(*testing.B) {
  function benchWrite (line 96) | func benchWrite[T any](constructor func() *T) func(*testing.B) {
  function benchFromDynamic (line 110) | func benchFromDynamic[T any](constructor func() *T) func(*testing.B) {

FILE: jsonutils/adapters/testintegration/benchmarks/payloads.go
  type SmallPayload (line 10) | type SmallPayload struct
  function NewSmallPayload (line 23) | func NewSmallPayload() *SmallPayload {
  type MediumPayload (line 37) | type MediumPayload struct
  constant mediumNumberOfAvatars (line 42) | mediumNumberOfAvatars = 8
  function NewMediumPayload (line 45) | func NewMediumPayload() *MediumPayload {
  type CBPerson (line 70) | type CBPerson struct
  type CBName (line 76) | type CBName struct
  type CBGithub (line 80) | type CBGithub struct
  type CBGravatar (line 84) | type CBGravatar struct
  type Avatars (line 88) | type Avatars
  type CBAvatar (line 90) | type CBAvatar struct
  type LargePayload (line 94) | type LargePayload struct
  constant largeNumberOfUsers (line 99) | largeNumberOfUsers = 100
  function NewLargePayload (line 101) | func NewLargePayload() *LargePayload {
  type DSUser (line 124) | type DSUser struct
  type DSUsers (line 128) | type DSUsers
  type DSTopicsList (line 130) | type DSTopicsList struct
  type DSTopic (line 135) | type DSTopic struct
  type DSTopics (line 140) | type DSTopics

FILE: jsonutils/adapters/testintegration/benchmarks/payloads_easyjson.go
  constant defaultEasyJSONAlloc (line 11) | defaultEasyJSONAlloc = 8
  method MarshalEasyJSON (line 14) | func (v SmallPayload) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 110) | func (v *SmallPayload) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 158) | func (v MediumPayload) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 187) | func (v *MediumPayload) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 229) | func (v CBPerson) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 276) | func (v *CBPerson) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 336) | func (v CBName) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 351) | func (v *CBName) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 383) | func (v CBGithub) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 393) | func (v *CBGithub) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 425) | func (v CBGravatar) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 451) | func (v *CBGravatar) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 512) | func (v CBAvatar) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 522) | func (v *CBAvatar) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 554) | func (v LargePayload) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 598) | func (v *LargePayload) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 669) | func (v DSUser) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 679) | func (v *DSUser) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 711) | func (v DSTopicsList) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 751) | func (v *DSTopicsList) UnmarshalEasyJSON(in *jlexer.Lexer) {
  method MarshalEasyJSON (line 814) | func (v DSTopic) MarshalEasyJSON(out *jwriter.Writer) {
  method UnmarshalEasyJSON (line 839) | func (v *DSTopic) UnmarshalEasyJSON(in *jlexer.Lexer) {

FILE: jsonutils/adapters/testintegration/benchmarks/payloads_test.go
  function TestPayloads (line 18) | func TestPayloads(t *testing.T) {
  function TestFixtures (line 24) | func TestFixtures(t *testing.T) {
  function verifyPayload (line 37) | func verifyPayload[T any](constructor func() *T) func(*testing.T) {

FILE: jsonutils/adapters/testintegration/ifaces.go
  type EJMarshaler (line 11) | type EJMarshaler interface
  type EJUnmarshaler (line 16) | type EJUnmarshaler interface

FILE: jsonutils/adapters/testintegration/integration_suite_test.go
  function TestMain (line 31) | func TestMain(m *testing.M) {
  type EasyObject (line 37) | type EasyObject struct
  function newEasyObject (line 44) | func newEasyObject() *EasyObject {
  type EasyTarget (line 78) | type EasyTarget struct
  type EasyOrderedObject (line 83) | type EasyOrderedObject struct
    method MarshalEasyJSON (line 110) | func (o EasyOrderedObject) MarshalEasyJSON(w *jwriter.Writer) {
    method UnmarshalEasyJSON (line 114) | func (o *EasyOrderedObject) UnmarshalEasyJSON(l *jlexer.Lexer) {
  function newEasyOrderedObject (line 90) | func newEasyOrderedObject() *EasyOrderedObject {
  type EasyOrderedTarget (line 118) | type EasyOrderedTarget struct
    method MarshalEasyJSON (line 124) | func (o *EasyOrderedTarget) MarshalEasyJSON(w *jwriter.Writer) {
    method UnmarshalEasyJSON (line 128) | func (o *EasyOrderedTarget) UnmarshalEasyJSON(l *jlexer.Lexer) {
  type assertionType (line 132) | type assertionType
  constant assertionTypeUnordered (line 135) | assertionTypeUnordered assertionType = iota
  constant assertionTypeOrdered (line 136) | assertionTypeOrdered
  type option (line 139) | type option
  type assertion (line 141) | type assertion
  type options (line 142) | type options struct
  function withAssertionsAfterRead (line 147) | func withAssertionsAfterRead(fn ...assertion) option {
  function withAssertionsAfterWrite (line 153) | func withAssertionsAfterWrite(fn ...assertion) option {
  function runTestSuite (line 159) | func runTestSuite[V any, T any](valueConstructor func() *V, targetConstr...
  type Error (line 172) | type Error
    method Error (line 174) | func (e Error) Error() string { return string(e) }
  constant errTestConfig (line 176) | errTestConfig Error = "error in test config"
  function testJSONTransforms (line 178) | func testJSONTransforms[V any, T any](test fixtures.Fixture, valueConstr...

FILE: jsonutils/adapters/testintegration/integration_test.go
  function TestIntegration (line 14) | func TestIntegration(t *testing.T) {

FILE: jsonutils/adapters/testintegration/mocks_test.go
  type MockEJMarshaler (line 36) | type MockEJMarshaler struct
    method MarshalEasyJSON (line 52) | func (mock *MockEJMarshaler) MarshalEasyJSON(w *jwriter.Writer) {
    method MarshalEasyJSONCalls (line 71) | func (mock *MockEJMarshaler) MarshalEasyJSONCalls() []struct {
  type MockEJUnmarshaler (line 102) | type MockEJUnmarshaler struct
    method UnmarshalEasyJSON (line 118) | func (mock *MockEJUnmarshaler) UnmarshalEasyJSON(w *jlexer.Lexer) {
    method UnmarshalEasyJSONCalls (line 137) | func (mock *MockEJUnmarshaler) UnmarshalEasyJSONCalls() []struct {

FILE: jsonutils/concat.go
  constant comma (line 13) | comma = byte(',')
  function init (line 17) | func init() {
  function ConcatJSON (line 28) | func ConcatJSON(blobs ...[]byte) []byte {

FILE: jsonutils/concat_test.go
  function TestJSONConcatenation (line 14) | func TestJSONConcatenation(t *testing.T) {

FILE: jsonutils/examples_test.go
  function ExampleReadJSON (line 12) | func ExampleReadJSON() {
  type A (line 31) | type A struct
  function ExampleFromDynamicJSON_struct (line 40) | func ExampleFromDynamicJSON_struct() {
  function ExampleFromDynamicJSON_orderedmap (line 62) | func ExampleFromDynamicJSON_orderedmap() {
  function ExampleConcatJSON_objects (line 84) | func ExampleConcatJSON_objects() {
  function ExampleConcatJSON_arrays (line 98) | func ExampleConcatJSON_arrays() {
  function ExampleJSONMapSlice (line 112) | func ExampleJSONMapSlice() {

FILE: jsonutils/fixtures_test/harness.go
  type TestCases (line 29) | type TestCases
  type Fixture (line 32) | type Fixture struct
    method JSONBytes (line 42) | func (f Fixture) JSONBytes() []byte {
    method YAMLBytes (line 47) | func (f Fixture) YAMLBytes() []byte {
    method ExpectError (line 52) | func (f Fixture) ExpectError() bool {
  type Harness (line 58) | type Harness struct
    method Init (line 79) | func (h *Harness) Init() {
    method Get (line 96) | func (h *Harness) Get(name string) (Fixture, bool) {
    method ShouldGet (line 102) | func (h *Harness) ShouldGet(name string) Fixture {
    method AllTests (line 142) | func (h *Harness) AllTests(filter ...Filter) iter.Seq2[string, Fixture] {
  function NewHarness (line 67) | func NewHarness(t testing.TB) *Harness {
  type testFile (line 73) | type testFile struct
  type Filter (line 109) | type Filter
  type filters (line 111) | type filters struct
  function WithError (line 118) | func WithError(only bool) Filter {
  function WithoutError (line 124) | func WithoutError(only bool) Filter {
  function WithExcludePattern (line 130) | func WithExcludePattern(rex *regexp.Regexp) Filter {
  function WithIncludePattern (line 136) | func WithIncludePattern(rex *regexp.Regexp) Filter {
  function ShouldLoadFixture (line 170) | func ShouldLoadFixture(t testing.TB, fsys fs.FS, pth string) []byte {
  function MustLoadFixture (line 177) | func MustLoadFixture(fsys fs.FS, pth string) []byte {
  function loadFixture (line 186) | func loadFixture(fsys fs.FS, pth string) ([]byte, error) {
  function JSONEqualOrdered (line 198) | func JSONEqualOrdered(t testing.TB, expected, actual string) {
  function JSONEqualOrderedBytes (line 206) | func JSONEqualOrderedBytes(t testing.TB, expected, actual []byte) {
  function YAMLEqualOrdered (line 273) | func YAMLEqualOrdered(t testing.TB, expected, actual string) {
  function YAMLEqualOrderedBytes (line 279) | func YAMLEqualOrderedBytes(t testing.TB, expected, actual []byte) {

FILE: jsonutils/fixtures_test/harness_test.go
  function TestHarness (line 12) | func TestHarness(t *testing.T) {
  function TestLoadFixture (line 54) | func TestLoadFixture(t *testing.T) {
  function TestJSONEqOrdered (line 60) | func TestJSONEqOrdered(t *testing.T) {
  function TestYAMLEqOrdered (line 67) | func TestYAMLEqOrdered(t *testing.T) {

FILE: jsonutils/json.go
  function WriteJSON (line 24) | func WriteJSON(value any) ([]byte, error) {
  function ReadJSON (line 66) | func ReadJSON(data []byte, value any) error {
  function FromDynamicJSON (line 109) | func FromDynamicJSON(source, target any) error {

FILE: jsonutils/json_test.go
  type SharedCounters (line 14) | type SharedCounters struct
  type AggregationObject (line 19) | type AggregationObject struct
    method UnmarshalJSON (line 25) | func (m *AggregationObject) UnmarshalJSON(raw []byte) error {
    method MarshalJSON (line 48) | func (m AggregationObject) MarshalJSON() ([]byte, error) {
  function TestReadWriteJSON (line 72) | func TestReadWriteJSON(t *testing.T) {

FILE: jsonutils/ordered_map.go
  type JSONMapSlice (line 16) | type JSONMapSlice
    method OrderedItems (line 22) | func (s JSONMapSlice) OrderedItems() iter.Seq2[string, any] {
    method SetOrderedItems (line 39) | func (s *JSONMapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
    method MarshalJSON (line 82) | func (s JSONMapSlice) MarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 94) | func (s *JSONMapSlice) UnmarshalJSON(data []byte) error {
  type JSONMapItem (line 111) | type JSONMapItem struct

FILE: jsonutils/ordered_map_test.go
  function TestJSONMapSlice (line 18) | func TestJSONMapSlice(t *testing.T) {
  function TestSetOrdered (line 119) | func TestSetOrdered(t *testing.T) {
  type customOrdered (line 180) | type customOrdered struct
    method Get (line 204) | func (o customOrdered) Get(key string) (any, bool) {
    method Set (line 213) | func (o *customOrdered) Set(key string, value any) bool {
    method OrderedItems (line 227) | func (o customOrdered) OrderedItems() iter.Seq2[string, any] {
    method SetOrderedItems (line 237) | func (o *customOrdered) SetOrderedItems(items iter.Seq2[string, any]) {
  function makeCustomOrdered (line 190) | func makeCustomOrdered(items ...JSONMapItem) customOrdered {

FILE: jsonutils_iface.go
  function WriteJSON (line 25) | func WriteJSON(data any) ([]byte, error) { return jsonutils.WriteJSON(da...
  function ReadJSON (line 30) | func ReadJSON(data []byte, value any) error { return jsonutils.ReadJSON(...
  function DynamicJSONToStruct (line 35) | func DynamicJSONToStruct(data any, target any) error {
  function ConcatJSON (line 42) | func ConcatJSON(blobs ...[]byte) []byte { return jsonutils.ConcatJSON(bl...
  function ToDynamicJSON (line 49) | func ToDynamicJSON(value any) any {
  function FromDynamicJSON (line 65) | func FromDynamicJSON(data, target any) error { return jsonutils.FromDyna...

FILE: jsonutils_iface_test.go
  function TestJSONUtilsIface (line 13) | func TestJSONUtilsIface(t *testing.T) {

FILE: loading/errors.go
  type loadingError (line 6) | type loadingError
    method Error (line 13) | func (e loadingError) Error() string {
  constant ErrLoader (line 10) | ErrLoader loadingError = "loader error"

FILE: loading/json.go
  function JSONMatcher (line 13) | func JSONMatcher(path string) bool {
  function JSONDoc (line 19) | func JSONDoc(path string, opts ...Option) (json.RawMessage, error) {

FILE: loading/json_test.go
  function TestJSONMatcher (line 15) | func TestJSONMatcher(t *testing.T) {
  function TestJSONDoc (line 24) | func TestJSONDoc(t *testing.T) {

FILE: loading/loading.go
  function LoadFromFileOrHTTP (line 21) | func LoadFromFileOrHTTP(pth string, opts ...Option) ([]byte, error) {
  function LoadStrategy (line 56) | func LoadStrategy(pth string, local, remote func(string) ([]byte, error)...
  function loadHTTPBytes (line 116) | func loadHTTPBytes(opts ...Option) func(path string) ([]byte, error) {

FILE: loading/loading_test.go
  function TestLoadFromHTTP (line 22) | func TestLoadFromHTTP(t *testing.T) {
  function TestLoadStrategy (line 198) | func TestLoadStrategy(t *testing.T) {
  function TestLoadStrategyFile (line 226) | func TestLoadStrategyFile(t *testing.T) {

FILE: loading/options.go
  type Option (line 15) | type Option
  type httpOptions (line 17) | type httpOptions struct
  type fileOptions (line 25) | type fileOptions struct
    method ReadFileFunc (line 35) | func (fo fileOptions) ReadFileFunc() func(string) ([]byte, error) {
  type options (line 29) | type options struct
  function WithTimeout (line 46) | func WithTimeout(timeout time.Duration) Option {
  function WithBasicAuth (line 53) | func WithBasicAuth(username, password string) Option {
  function WithCustomHeaders (line 61) | func WithCustomHeaders(headers map[string]string) Option {
  function WithHTTPClient (line 76) | func WithHTTPClient(client *http.Client) Option {
  function WithFS (line 90) | func WithFS(filesystem fs.FS) Option {
  type readFileFS (line 101) | type readFileFS struct
    method ReadFile (line 105) | func (r readFileFS) ReadFile(name string) ([]byte, error) {
  function optionsWithDefaults (line 109) | func optionsWithDefaults(opts []Option) options {

FILE: loading/serve_test.go
  function TestMain (line 24) | func TestMain(m *testing.M) {
  function serveYAMLPetStore (line 34) | func serveYAMLPetStore(rw http.ResponseWriter, _ *http.Request) {
  function serveJSONPetStore (line 40) | func serveJSONPetStore(rw http.ResponseWriter, _ *http.Request) {
  function serveOK (line 45) | func serveOK(rw http.ResponseWriter, _ *http.Request) {
  function serveKO (line 50) | func serveKO(rw http.ResponseWriter, _ *http.Request) {
  function serveBasicAuthFunc (line 54) | func serveBasicAuthFunc(user, password string) func(http.ResponseWriter,...
  function serveRequireHeaderFunc (line 67) | func serveRequireHeaderFunc(key, value string) func(http.ResponseWriter,...
  function mustLoadFixture (line 87) | func mustLoadFixture(name string) []byte {

FILE: loading/yaml.go
  function YAMLMatcher (line 14) | func YAMLMatcher(path string) bool {
  function YAMLDoc (line 20) | func YAMLDoc(path string, opts ...Option) (json.RawMessage, error) {
  function YAMLData (line 30) | func YAMLData(path string, opts ...Option) (any, error) {

FILE: loading/yaml_test.go
  function TestYAMLMatcher (line 16) | func TestYAMLMatcher(t *testing.T) {
  function TestYAMLDoc (line 24) | func TestYAMLDoc(t *testing.T) {

FILE: loading_iface.go
  function LoadFromFileOrHTTP (line 40) | func LoadFromFileOrHTTP(pth string, opts ...loading.Option) ([]byte, err...
  function LoadFromFileOrHTTPWithTimeout (line 48) | func LoadFromFileOrHTTPWithTimeout(pth string, timeout time.Duration, op...
  function LoadStrategy (line 57) | func LoadStrategy(pth string, local, remote func(string) ([]byte, error)...
  function YAMLMatcher (line 64) | func YAMLMatcher(path string) bool { return loading.YAMLMatcher(path) }
  function YAMLDoc (line 69) | func YAMLDoc(path string) (json.RawMessage, error) {
  function YAMLData (line 76) | func YAMLData(path string) (any, error) {
  function loadingOptionsWithDefaults (line 82) | func loadingOptionsWithDefaults(opts []loading.Option) []loading.Option {

FILE: loading_iface_test.go
  function TestLoadFromHTTP (line 18) | func TestLoadFromHTTP(t *testing.T) {
  function TestYAMLDoc (line 132) | func TestYAMLDoc(t *testing.T) {

FILE: mangling/fuzz_test.go
  function FuzzToGoName (line 15) | func FuzzToGoName(f *testing.F) {
  function generators (line 33) | func generators() iter.Seq[string] {

FILE: mangling/initialism_index.go
  function DefaultInitialisms (line 60) | func DefaultInitialisms() []string {
  type indexOfInitialisms (line 106) | type indexOfInitialisms struct
    method add (line 118) | func (m *indexOfInitialisms) add(words ...string) *indexOfInitialisms {
    method sorted (line 141) | func (m *indexOfInitialisms) sorted() []string {
    method buildCache (line 150) | func (m *indexOfInitialisms) buildCache() {
    method pluralForm (line 203) | func (m *indexOfInitialisms) pluralForm(key string) pluralForm {
  function newIndexOfInitialisms (line 112) | func newIndexOfInitialisms() *indexOfInitialisms {
  type initialismsCache (line 156) | type initialismsCache struct
    method build (line 163) | func (c *initialismsCache) build(in []string, pluralfunc func(string) ...
  type pluralForm (line 174) | type pluralForm
    method String (line 182) | func (f pluralForm) String() string {
  constant notPlural (line 177) | notPlural pluralForm = iota
  constant invariantPlural (line 178) | invariantPlural
  constant simplePlural (line 179) | simplePlural
  type byInitialism (line 223) | type byInitialism
    method Len (line 225) | func (s byInitialism) Len() int {
    method Swap (line 228) | func (s byInitialism) Swap(i, j int) {
    method Less (line 235) | func (s byInitialism) Less(i, j int) bool {
  function asRunes (line 243) | func asRunes(in []string) [][]rune {
  function asUpperCased (line 252) | func asUpperCased(in []string) [][]rune {
  function asPluralForms (line 263) | func asPluralForms(in []string, pluralFunc func(string) pluralForm) []pl...

FILE: mangling/initialism_index_test.go
  function TestInitialismSorted (line 14) | func TestInitialismSorted(t *testing.T) {
  function TestInitialismPlural (line 65) | func TestInitialismPlural(t *testing.T) {
  function TestInitialismSanitize (line 82) | func TestInitialismSanitize(t *testing.T) {

FILE: mangling/name_lexem.go
  type lexemKind (line 14) | type lexemKind
  type nameLexem (line 16) | type nameLexem struct
    method WriteTitleized (line 47) | func (l nameLexem) WriteTitleized(w *bytes.Buffer, alwaysUpper bool) b...
    method WriteLower (line 115) | func (l nameLexem) WriteLower(w *bytes.Buffer, alwaysLower bool) bool {
    method GetOriginal (line 180) | func (l nameLexem) GetOriginal() string {
    method IsInitialism (line 184) | func (l nameLexem) IsInitialism() bool {
  constant lexemKindCasualName (line 24) | lexemKindCasualName lexemKind = iota
  constant lexemKindInitialismName (line 25) | lexemKindInitialismName
  function newInitialismNameLexem (line 28) | func newInitialismNameLexem(original, matchedInitialism string) nameLexem {
  function newCasualNameLexem (line 36) | func newCasualNameLexem(original string) nameLexem {

FILE: mangling/name_lexem_test.go
  function TestLexemEdgeCases (line 13) | func TestLexemEdgeCases(t *testing.T) {

FILE: mangling/name_mangler.go
  type NameMangler (line 34) | type NameMangler struct
    method AddInitialisms (line 86) | func (m *NameMangler) AddInitialisms(words ...string) {
    method Initialisms (line 91) | func (m *NameMangler) Initialisms() []string {
    method Camelize (line 100) | func (m NameMangler) Camelize(word string) string {
    method ToFileName (line 132) | func (m NameMangler) ToFileName(name string) string {
    method ToCommandName (line 153) | func (m NameMangler) ToCommandName(name string) string {
    method ToHumanNameLower (line 176) | func (m NameMangler) ToHumanNameLower(name string) string {
    method ToHumanNameTitle (line 202) | func (m NameMangler) ToHumanNameTitle(name string) string {
    method ToJSONName (line 228) | func (m NameMangler) ToJSONName(name string) string {
    method ToVarName (line 260) | func (m NameMangler) ToVarName(name string) string {
    method ToGoName (line 294) | func (m NameMangler) ToGoName(name string) string {
    method goIdentifier (line 298) | func (m NameMangler) goIdentifier(name string, exported bool) string {
    method addInitialisms (line 353) | func (m *NameMangler) addInitialisms(words ...string) {
    method split (line 359) | func (m NameMangler) split(str string) *[]string {
  function NewNameMangler (line 48) | func NewNameMangler(opts ...Option) NameMangler {

FILE: mangling/name_mangler_benchmark_test.go
  function BenchmarkToXXXName (line 12) | func BenchmarkToXXXName(b *testing.B) {
  function benchmarkFunc (line 34) | func benchmarkFunc(fn func(string) string, samples []string) func(*testi...

FILE: mangling/name_mangler_test.go
  constant textTitle (line 16) | textTitle  = "Text"
  constant blankText (line 17) | blankText  = " text"
  constant dashText (line 18) | dashText   = "-text"
  constant uscoreText (line 19) | uscoreText = "_text"
  constant sampleTitle (line 21) | sampleTitle  = "Sample"
  constant sampleString (line 22) | sampleString = "sample"
  constant sampleBlank (line 23) | sampleBlank  = "sample "
  constant sampleDash (line 24) | sampleDash   = "sample-"
  constant sampleUscore (line 25) | sampleUscore = "sample_"
  function TestManglerToGoName_Issue158 (line 28) | func TestManglerToGoName_Issue158(t *testing.T) {
  function TestManglerToGoName_Issue159 (line 38) | func TestManglerToGoName_Issue159(t *testing.T) {
  function TestManglerToGoName (line 49) | func TestManglerToGoName(t *testing.T) {
  function TestManglerToFileName (line 243) | func TestManglerToFileName(t *testing.T) {
  function TestManglerToCommandName (line 275) | func TestManglerToCommandName(t *testing.T) {
  function TestManglerToHumanName (line 298) | func TestManglerToHumanName(t *testing.T) {
  function TestManglerToJSONName (line 321) | func TestManglerToJSONName(t *testing.T) {
  function TestManglerCamelize (line 344) | func TestManglerCamelize(t *testing.T) {
  function TestManglerToHumanNameTitle (line 384) | func TestManglerToHumanNameTitle(t *testing.T) {
  function TestManglerToVarName (line 410) | func TestManglerToVarName(t *testing.T) {
  function TestManglerInitialisms (line 478) | func TestManglerInitialisms(t *testing.T) {

FILE: mangling/options.go
  type PrefixFunc (line 11) | type PrefixFunc
  type ReplaceFunc (line 14) | type ReplaceFunc
  type Option (line 17) | type Option
  type options (line 19) | type options struct
    method prefixFunc (line 28) | func (o *options) prefixFunc() PrefixFunc {
  function WithGoNamePrefixFunc (line 49) | func WithGoNamePrefixFunc(fn PrefixFunc) Option {
  function WithGoNamePrefixFuncPtr (line 66) | func WithGoNamePrefixFuncPtr(ptr *PrefixFunc) Option {
  function WithInitialisms (line 80) | func WithInitialisms(words ...string) Option {
  function WithAdditionalInitialisms (line 89) | func WithAdditionalInitialisms(words ...string) Option {
  function WithReplaceFunc (line 106) | func WithReplaceFunc(fn ReplaceFunc) Option {
  function defaultPrefixFunc (line 112) | func defaultPrefixFunc(_ string) string {
  function defaultReplaceTable (line 117) | func defaultReplaceTable(r rune) (string, bool) {
  function optionsWithDefaults (line 138) | func optionsWithDefaults(opts []Option) options {

FILE: mangling/pools.go
  constant maxAllocMatches (line 11) | maxAllocMatches = 8
  type matchesPool (line 19) | type matchesPool struct
    method BorrowMatches (line 77) | func (p matchesPool) BorrowMatches() *initialismMatches {
    method RedeemMatches (line 109) | func (p matchesPool) RedeemMatches(s *initialismMatches) {
  type buffersPool (line 23) | type buffersPool struct
    method BorrowBuffer (line 84) | func (p buffersPool) BorrowBuffer(size int) *bytes.Buffer {
    method RedeemBuffer (line 113) | func (p buffersPool) RedeemBuffer(s *bytes.Buffer) {
  type lexemsPool (line 27) | type lexemsPool struct
    method BorrowLexems (line 95) | func (p lexemsPool) BorrowLexems() *[]nameLexem {
    method RedeemLexems (line 117) | func (p lexemsPool) RedeemLexems(s *[]nameLexem) {
  type stringsPool (line 31) | type stringsPool struct
    method BorrowStrings (line 102) | func (p stringsPool) BorrowStrings() *[]string {
    method RedeemStrings (line 121) | func (p stringsPool) RedeemStrings(s *[]string) {

FILE: mangling/split.go
  type splitterOption (line 11) | type splitterOption
  function withPostSplitInitialismCheck (line 14) | func withPostSplitInitialismCheck(s *splitter) {
  function withReplaceFunc (line 18) | func withReplaceFunc(fn ReplaceFunc) func(*splitter) {
  function withInitialismsCache (line 24) | func withInitialismsCache(c *initialismsCache) splitterOption {
  type initialismMatch (line 31) | type initialismMatch struct
    method String (line 41) | func (m initialismMatch) String() string {
    method isZero (line 47) | func (m initialismMatch) isZero() bool {
  type initialismMatches (line 37) | type initialismMatches
  type splitter (line 51) | type splitter struct
    method split (line 72) | func (s splitter) split(name string) *[]nameLexem {
    method gatherInitialismMatches (line 82) | func (s splitter) gatherInitialismMatches(nameRunes []rune) *initialis...
    method findMatches (line 204) | func (s splitter) findMatches(newMatches *initialismMatches, nameRunes...
    method mapMatchesToNameLexems (line 225) | func (s splitter) mapMatchesToNameLexems(nameRunes []rune, matches *in...
    method breakInitialism (line 268) | func (s splitter) breakInitialism(original string) nameLexem {
    method appendBrokenDownCasualString (line 272) | func (s splitter) appendBrokenDownCasualString(segments *[]nameLexem, ...
  function newSplitter (line 58) | func newSplitter(options ...splitterOption) splitter {

FILE: mangling/split_test.go
  function TestSplitPluralized (line 13) | func TestSplitPluralized(t *testing.T) {
  function TestSplitter (line 174) | func TestSplitter(t *testing.T) {

FILE: mangling/string_bytes.go
  function hackStringBytes (line 9) | func hackStringBytes(str string) []byte {

FILE: mangling/util.go
  function trim (line 13) | func trim(str string) string { return strings.TrimSpace(str) }
  function upper (line 16) | func upper(str string) string {
  function lower (line 21) | func lower(str string) string {
  function isEqualFoldIgnoreSpace (line 33) | func isEqualFoldIgnoreSpace(base []rune, str string) bool {

FILE: mangling/util_test.go
  type translationSample (line 13) | type translationSample struct
  function titleize (line 17) | func titleize(s string) string { return strings.ToTitle(s[:1]) + lower(s...
  function TestIsEqualFoldIgnoreSpace (line 19) | func TestIsEqualFoldIgnoreSpace(t *testing.T) {

FILE: mangling_iface.go
  function AddInitialisms (line 27) | func AddInitialisms(words ...string) {
  function Camelize (line 34) | func Camelize(word string) string { return swagNameMangler.Camelize(word) }
  function ToFileName (line 39) | func ToFileName(name string) string { return swagNameMangler.ToFileName(...
  function ToCommandName (line 44) | func ToCommandName(name string) string { return swagNameMangler.ToComman...
  function ToHumanNameLower (line 49) | func ToHumanNameLower(name string) string { return swagNameMangler.ToHum...
  function ToHumanNameTitle (line 54) | func ToHumanNameTitle(name string) string { return swagNameMangler.ToHum...
  function ToJSONName (line 59) | func ToJSONName(name string) string { return swagNameMangler.ToJSONName(...
  function ToVarName (line 64) | func ToVarName(name string) string { return swagNameMangler.ToVarName(na...
  function ToGoName (line 69) | func ToGoName(name string) string { return swagNameMangler.ToGoName(name) }

FILE: mangling_iface_test.go
  function TestManglingIface (line 12) | func TestManglingIface(t *testing.T) {

FILE: netutils/net.go
  function SplitHostPort (line 16) | func SplitHostPort(addr string) (host string, port int, err error) {

FILE: netutils/net_test.go
  function TestSplitHostPort (line 13) | func TestSplitHostPort(t *testing.T) {

FILE: netutils_iface.go
  function SplitHostPort (line 11) | func SplitHostPort(addr string) (host string, port int, err error) {

FILE: netutils_iface_test.go
  function TestNetUtilsIface (line 13) | func TestNetUtilsIface(t *testing.T) {

FILE: stringutils/collection_formats.go
  constant collectionFormatSpace (line 10) | collectionFormatSpace = "ssv"
  constant collectionFormatTab (line 11) | collectionFormatTab   = "tsv"
  constant collectionFormatPipe (line 12) | collectionFormatPipe  = "pipes"
  constant collectionFormatMulti (line 13) | collectionFormatMulti = "multi"
  constant collectionFormatDefaultSep (line 15) | collectionFormatDefaultSep = ","
  function JoinByFormat (line 24) | func JoinByFormat(data []string, format string) []string {
  function SplitByFormat (line 50) | func SplitByFormat(data, format string) []string {

FILE: stringutils/collection_formats_test.go
  constant collectionFormatComma (line 13) | collectionFormatComma = "csv"
  function TestSplitByFormat (line 15) | func TestSplitByFormat(t *testing.T) {
  function TestJoinByFormat (line 40) | func TestJoinByFormat(t *testing.T) {

FILE: stringutils/strings.go
  function ContainsStrings (line 14) | func ContainsStrings(coll []string, item string) bool {
  function ContainsStringsCI (line 19) | func ContainsStringsCI(coll []string, item string) bool {

FILE: stringutils/strings_test.go
  function TestContainsStringsCI (line 12) | func TestContainsStringsCI(t *testing.T) {
  function TestContainsStrings (line 21) | func TestContainsStrings(t *testing.T) {

FILE: stringutils_iface.go
  function ContainsStrings (line 11) | func ContainsStrings(coll []string, item string) bool {
  function ContainsStringsCI (line 18) | func ContainsStringsCI(coll []string, item string) bool {
  function JoinByFormat (line 25) | func JoinByFormat(data []string, format string) []string {
  function SplitByFormat (line 32) | func SplitByFormat(data, format string) []string {

FILE: stringutils_iface_test.go
  function TestStringUtilsIface (line 13) | func TestStringUtilsIface(t *testing.T) {

FILE: typeutils/types.go
  type zeroable (line 8) | type zeroable interface
  function IsZero (line 14) | func IsZero(data any) bool {
  function IsNil (line 62) | func IsNil(input any) bool {

FILE: typeutils/types_test.go
  type SimpleZeroes (line 15) | type SimpleZeroes struct
  type ZeroesWithTime (line 20) | type ZeroesWithTime struct
  type dummyZeroable (line 24) | type dummyZeroable struct
    method IsZero (line 28) | func (d dummyZeroable) IsZero() bool {
  function TestIsZero (line 32) | func TestIsZero(t *testing.T) {
  function TestIsNil (line 119) | func TestIsNil(t *testing.T) {

FILE: typeutils_iface.go
  function IsZero (line 12) | func IsZero(data any) bool { return typeutils.IsZero(data) }

FILE: typeutils_iface_test.go
  function TestTypeUtilsIface (line 12) | func TestTypeUtilsIface(t *testing.T) {

FILE: yamlutils/errors.go
  type yamlError (line 6) | type yamlError
    method Error (line 13) | func (e yamlError) Error() string {
  constant ErrYAML (line 10) | ErrYAML yamlError = "yaml error"

FILE: yamlutils/examples_test.go
  function ExampleYAMLToJSON (line 13) | func ExampleYAMLToJSON() {
  function ExampleYAMLMapSlice (line 48) | func ExampleYAMLMapSlice() {

FILE: yamlutils/ordered_map.go
  type YAMLMapSlice (line 30) | type YAMLMapSlice
    method OrderedItems (line 38) | func (s YAMLMapSlice) OrderedItems() iter.Seq2[string, any] {
    method SetOrderedItems (line 50) | func (s *YAMLMapSlice) SetOrderedItems(items iter.Seq2[string, any]) {
    method MarshalJSON (line 93) | func (s YAMLMapSlice) MarshalJSON() ([]byte, error) {
    method UnmarshalJSON (line 100) | func (s *YAMLMapSlice) UnmarshalJSON(data []byte) error {
    method MarshalYAML (line 117) | func (s YAMLMapSlice) MarshalYAML() (any, error) {
    method UnmarshalYAML (line 155) | func (s *YAMLMapSlice) UnmarshalYAML(node *yaml.Node) error {
  function json2yaml (line 189) | func json2yaml(item any) (*yaml.Node, error) {
  function floatNode (line 276) | func floatNode[T conv.Float](val T) (*yaml.Node, error) {
  function integerNode (line 284) | func integerNode[T conv.Signed](val T) (*yaml.Node, error) {
  function uintegerNode (line 292) | func uintegerNode[T conv.Unsigned](val T) (*yaml.Node, error) {
  function orderedYAML (line 300) | func orderedYAML[T ifaces.Ordered](val T) (*yaml.Node, error) {

FILE: yamlutils/ordered_map_test.go
  function TestOrderedMap (line 16) | func TestOrderedMap(t *testing.T) {
  function TestMarshalYAML (line 118) | func TestMarshalYAML(t *testing.T) {
  function TestUnmarshalYAML (line 306) | func TestUnmarshalYAML(t *testing.T) {
  function TestSetOrdered (line 315) | func TestSetOrdered(t *testing.T) {

FILE: yamlutils/yaml.go
  function YAMLToJSON (line 20) | func YAMLToJSON(value any) (json.RawMessage, error) {
  function BytesToYAMLDoc (line 36) | func BytesToYAMLDoc(data []byte) (any, error) {
  function yamlNode (line 47) | func yamlNode(root *yaml.Node) (any, error) {
  function yamlDocument (line 64) | func yamlDocument(node *yaml.Node) (any, error) {
  function yamlMapping (line 71) | func yamlMapping(node *yaml.Node) (any, error) {
  function yamlSequence (line 82) | func yamlSequence(node *yaml.Node) (any, error) {
  constant yamlStringScalar (line 96) | yamlStringScalar = "tag:yaml.org,2002:str"
  constant yamlIntScalar (line 97) | yamlIntScalar    = "tag:yaml.org,2002:int"
  constant yamlBoolScalar (line 98) | yamlBoolScalar   = "tag:yaml.org,2002:bool"
  constant yamlFloatScalar (line 99) | yamlFloatScalar  = "tag:yaml.org,2002:float"
  constant yamlTimestamp (line 100) | yamlTimestamp    = "tag:yaml.org,2002:timestamp"
  constant yamlNull (line 101) | yamlNull         = "tag:yaml.org,2002:null"
  function yamlScalar (line 104) | func yamlScalar(node *yaml.Node) (any, error) {
  function yamlStringScalarC (line 136) | func yamlStringScalarC(node *yaml.Node) (string, error) {
  function format (line 148) | func format(t any) (string, error) {
  function transformData (line 177) | func transformData(input any) (out any, err error) {

FILE: yamlutils/yaml_test.go
  function TestMain (line 28) | func TestMain(m *testing.M) {
  function TestYAMLToJSON (line 37) | func TestYAMLToJSON(t *testing.T) {
  function TestWithYKey (line 182) | func TestWithYKey(t *testing.T) {
  function TestMapKeyTypes (line 209) | func TestMapKeyTypes(t *testing.T) {
  function TestYAMLTags (line 227) | func TestYAMLTags(t *testing.T) {
  function TestYAMLEdgeCases (line 263) | func TestYAMLEdgeCases(t *testing.T) {
  function mustLoadFixture (line 299) | func mustLoadFixture(name string) []byte {

FILE: yamlutils_iface.go
  function YAMLToJSON (line 15) | func YAMLToJSON(data any) (json.RawMessage, error) { return yamlutils.YA...
  function BytesToYAMLDoc (line 20) | func BytesToYAMLDoc(data []byte) (any, error) { return yamlutils.BytesTo...

FILE: yamlutils_iface_test.go
  function TestYAMLUtilsIface (line 12) | func TestYAMLUtilsIface(t *testing.T) {
Condensed preview — 223 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,836K chars).
[
  {
    "path": ".claude/.gitignore",
    "chars": 40,
    "preview": "plans/\nskills/\ncommands/\nagents/\nhooks/\n"
  },
  {
    "path": ".claude/CLAUDE.md",
    "chars": 3428,
    "preview": "# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## "
  },
  {
    "path": ".claude/rules/contributions.md",
    "chars": 1419,
    "preview": "---\npaths:\n  - \"**/*\"\n---\n\n# Contribution rules (go-openapi)\n\nRead `.github/CONTRIBUTING.md` before opening a pull reque"
  },
  {
    "path": ".claude/rules/github-workflows-conventions.md",
    "chars": 8555,
    "preview": "---\npaths:\n  - \".github/workflows/**.yml\"\n  - \".github/workflows/**.yaml\"\n---\n\n# GitHub Actions Workflows Formatting and"
  },
  {
    "path": ".claude/rules/go-conventions.md",
    "chars": 306,
    "preview": "---\npaths:\n  - \"**/*.go\"\n---\n\n# Code conventions (go-openapi)\n\n- All files must have SPDX license headers (Apache-2.0).\n"
  },
  {
    "path": ".claude/rules/linting.md",
    "chars": 403,
    "preview": "---\npaths:\n  - \"**/*.go\"\n---\n\n# Linting conventions (go-openapi)\n\n```sh\ngolangci-lint run\n```\n\nConfig: `.golangci.yml` —"
  },
  {
    "path": ".claude/rules/testing.md",
    "chars": 968,
    "preview": "---\npaths:\n  - \"**/*_test.go\"\n---\n\n# Testing conventions (go-openapi)\n\n## Running tests\n\n**Single module repos:**\n\n```sh"
  },
  {
    "path": ".codecov.yml",
    "chars": 122,
    "preview": "ignore:\n  - jsonutils/fixtures_test\n  - jsonutils/adapters/ifaces/mocks\n  - jsonutils/adapters/testintegration/benchmark"
  },
  {
    "path": ".editorconfig",
    "chars": 539,
    "preview": "# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines with a newline ending every file\n[*]\nend_of_line = lf\nin"
  },
  {
    "path": ".gitattributes",
    "chars": 75,
    "preview": "# gofmt always uses LF, whereas Git uses CRLF on Windows.\n*.go text eol=lf\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "chars": 8700,
    "preview": "You'll find here general guidelines to contribute to this project.\nThey mostly correspond to standard practices for open"
  },
  {
    "path": ".github/DCO.md",
    "chars": 1467,
    "preview": "# Developer's Certificate of Origin\n\n```\nDeveloper Certificate of Origin\nVersion 1.1\n\nCopyright (C) 2004, 2006 The Linux"
  },
  {
    "path": ".github/copilot-instructions.md",
    "chars": 1533,
    "preview": "# Copilot Instructions\n\n## Project Overview\n\nGo mono-repo of utility libraries for the `go-openapi` / `go-swagger` ecosy"
  },
  {
    "path": ".github/dependabot.yaml",
    "chars": 1975,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n  "
  },
  {
    "path": ".github/wordlist.txt",
    "chars": 2323,
    "preview": "API\nAPIs\nAcknowledgements\nAutocomplete\nBDD\nBSON\nCI\nCIDR\nCLI\nCLIs\nCSV\nCodeFactor\nCodeQL\nDCO\nDSL\nDockerHub\nEnablement\nFAQ\n"
  },
  {
    "path": ".github/workflows/auto-merge.yml",
    "chars": 306,
    "preview": "name: Dependabot auto-merge\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n\njobs:\n  dependabot:\n    permissions:\n  "
  },
  {
    "path": ".github/workflows/bump-release.yml",
    "chars": 1034,
    "preview": "name: Bump Release\n\npermissions:\n  contents: read\n\n\non:\n  workflow_dispatch:\n    inputs:\n      bump-type:\n        descri"
  },
  {
    "path": ".github/workflows/codeql.yml",
    "chars": 473,
    "preview": "name: \"CodeQL\"\n\non:\n  push:\n    branches: [ \"master\" ]\n  pull_request:\n    branches: [ \"master\" ]\n    paths-ignore: # re"
  },
  {
    "path": ".github/workflows/contributors.yml",
    "chars": 344,
    "preview": "name: Contributors\n\non:\n  schedule:\n    - cron: '18 4 * * 6'\n\n  workflow_dispatch:\n\npermissions:\n  contents: read\n\njobs:"
  },
  {
    "path": ".github/workflows/go-test.yml",
    "chars": 286,
    "preview": "name: go test\n\npermissions:\n  pull-requests: read\n  contents: read\n\non:\n  push:\n    branches:\n      - master\n\n  pull_req"
  },
  {
    "path": ".github/workflows/scanner.yml",
    "chars": 380,
    "preview": "name: Vulnerability scans\n\non:\n  branch_protection_rule:\n  push:\n    branches: [\"master\"]\n  schedule:\n    - cron: \"18 4 "
  },
  {
    "path": ".github/workflows/tag-release.yml",
    "chars": 381,
    "preview": "name: Release on tag\n\npermissions:\n  contents: read\n\non:\n  push:\n    tags:\n      - v[0-9]+*\n\njobs:\n  gh-release:\n    nam"
  },
  {
    "path": ".gitignore",
    "chars": 48,
    "preview": "secrets.yml\nvendor\nGodeps\n.idea\n*.out\n.mcp.json\n"
  },
  {
    "path": ".golangci.yml",
    "chars": 1343,
    "preview": "version: \"2\"\nlinters:\n  default: all\n  disable:\n    - cyclop\n    - depguard\n    - errchkjson\n    - errorlint\n    - exhau"
  },
  {
    "path": ".mockery.yml",
    "chars": 800,
    "preview": "all: false\ndir: '{{.InterfaceDir}}'\nfilename: mocks_test.go\nforce-file-write: true\nformatter: goimports\ninclude-auto-gen"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3239,
    "preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
  },
  {
    "path": "CONTRIBUTORS.md",
    "chars": 2307,
    "preview": "# Contributors\n\n- Repository: ['go-openapi/swag']\n\n| Total Contributors | Total Contributions |\n| --- | --- |\n| 24  | 24"
  },
  {
    "path": "LICENSE",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "README.md",
    "chars": 9296,
    "preview": "# Swag\n\n<!-- Badges: status  -->\n[![Tests][test-badge]][test-url] [![Coverage][cov-badge]][cov-url] [![CI vuln scan][vul"
  },
  {
    "path": "SECURITY.md",
    "chars": 1411,
    "preview": "# Security Policy\n\nThis policy outlines the commitment and practices of the go-openapi maintainers regarding security.\n\n"
  },
  {
    "path": "cmdutils/cmd_utils.go",
    "chars": 432,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage cm"
  },
  {
    "path": "cmdutils/doc.go",
    "chars": 194,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "cmdutils/go.mod",
    "chars": 54,
    "preview": "module github.com/go-openapi/swag/cmdutils\n\ngo 1.25.0\n"
  },
  {
    "path": "cmdutils/go.sum",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "cmdutils_iface.go",
    "chars": 384,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "cmdutils_iface_test.go",
    "chars": 123,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "conv/convert.go",
    "chars": 3848,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/convert_format_test.go",
    "chars": 17348,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/convert_types.go",
    "chars": 1623,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/convert_types_test.go",
    "chars": 5156,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/doc.go",
    "chars": 686,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "conv/format.go",
    "chars": 761,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/go.mod",
    "chars": 212,
    "preview": "module github.com/go-openapi/swag/conv\n\nrequire (\n\tgithub.com/go-openapi/swag/typeutils v0.26.0\n\tgithub.com/go-openapi/t"
  },
  {
    "path": "conv/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "conv/sizeof.go",
    "chars": 716,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv/type_constraints.go",
    "chars": 755,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage co"
  },
  {
    "path": "conv_iface.go",
    "chars": 19841,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "conv_iface_test.go",
    "chars": 4994,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "doc.go",
    "chars": 1432,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "docs/MAINTAINERS.md",
    "chars": 7190,
    "preview": "> [!NOTE]\n> Comprehensive guide for maintainers covering repository structure, CI/CD workflows, release procedures, and "
  },
  {
    "path": "docs/NOTES.md",
    "chars": 3529,
    "preview": "# pre-v0.26.0 release notes\n\n## v0.25.4\n\n**mangling**\n\nBug fix\n\n* [x] mangler may panic with pluralized overlapping init"
  },
  {
    "path": "docs/STYLE.md",
    "chars": 5923,
    "preview": "# Coding style at `go-openapi`\n\n> **TL;DR**\n>\n> Let's be honest: at `go-openapi` and `go-swagger` we've never been super"
  },
  {
    "path": "docs/TODOS.md",
    "chars": 1171,
    "preview": "# Roadmap\n\nA few ideas on the todo list:\n\n* [x] Complete the split of dependencies to isolate easyjson from the rest\n* ["
  },
  {
    "path": "fileutils/doc.go",
    "chars": 437,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "fileutils/file.go",
    "chars": 445,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "fileutils/file_test.go",
    "chars": 563,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "fileutils/go.mod",
    "chars": 104,
    "preview": "module github.com/go-openapi/swag/fileutils\n\nrequire github.com/go-openapi/testify/v2 v2.5.0\n\ngo 1.25.0\n"
  },
  {
    "path": "fileutils/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "fileutils/path.go",
    "chars": 1473,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "fileutils/path_test.go",
    "chars": 2554,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "fileutils_iface.go",
    "chars": 1065,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "fileutils_iface_test.go",
    "chars": 893,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "go.mod",
    "chars": 1377,
    "preview": "module github.com/go-openapi/swag\n\nretract v0.24.0 // bad tagging of the main module: superseeded by v0.24.1\n\nrequire (\n"
  },
  {
    "path": "go.sum",
    "chars": 754,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.4.2 h1:5zRca5jw7lzVREKCZVNBpysDNBjj74rBh0N2BGQbSR0=\ngithub.com/go-openap"
  },
  {
    "path": "go.work",
    "chars": 301,
    "preview": "use (\n\t.\n\t./cmdutils\n\t./conv\n\t./fileutils\n\t./jsonname\n\t./jsonutils\n\t./jsonutils/adapters/easyjson\n\t./jsonutils/adapters/"
  },
  {
    "path": "go.work.sum",
    "chars": 558,
    "preview": "github.com/go-openapi/testify/v2 v2.0.1/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=\ngolang.org/x/mod v0.21.0 "
  },
  {
    "path": "hack/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "jsonname/doc.go",
    "chars": 204,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonname/go.mod",
    "chars": 103,
    "preview": "module github.com/go-openapi/swag/jsonname\n\nrequire github.com/go-openapi/testify/v2 v2.5.0\n\ngo 1.25.0\n"
  },
  {
    "path": "jsonname/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "jsonname/go_name_provider.go",
    "chars": 7056,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonname/go_name_provider_test.go",
    "chars": 8971,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonname/ifaces.go",
    "chars": 543,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonname/name_provider.go",
    "chars": 3505,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonname/name_provider_test.go",
    "chars": 2919,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonname_iface.go",
    "chars": 751,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "jsonname_iface_test.go",
    "chars": 338,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "jsonutils/README.md",
    "chars": 3940,
    "preview": "# jsonutils\n\n`jsonutils` exposes a few tools to work with JSON:\n\n- a fast, simple `Concat` to concatenate (not merge) JS"
  },
  {
    "path": "jsonutils/adapters/doc.go",
    "chars": 285,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/easyjson/doc.go",
    "chars": 528,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/easyjson/go.mod",
    "chars": 791,
    "preview": "module github.com/go-openapi/swag/jsonutils/adapters/easyjson\n\nrequire (\n\tgithub.com/go-openapi/swag/conv v0.26.0\n\tgithu"
  },
  {
    "path": "jsonutils/adapters/easyjson/go.sum",
    "chars": 1098,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/adapter.go",
    "chars": 2911,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/adapter_test.go",
    "chars": 1710,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/doc.go",
    "chars": 305,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/options.go",
    "chars": 873,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/ordered_map.go",
    "chars": 5103,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/ordered_map_test.go",
    "chars": 1069,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/pool.go",
    "chars": 2605,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/easyjson/json/register.go",
    "chars": 1370,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/ifaces/doc.go",
    "chars": 189,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/ifaces/ifaces.go",
    "chars": 2187,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage if"
  },
  {
    "path": "jsonutils/adapters/ifaces/mocks/mocks.go",
    "chars": 46018,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Code ge"
  },
  {
    "path": "jsonutils/adapters/ifaces/registry_iface.go",
    "chars": 2165,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage if"
  },
  {
    "path": "jsonutils/adapters/ifaces/registry_ifaces_test.go",
    "chars": 1650,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage if"
  },
  {
    "path": "jsonutils/adapters/registry.go",
    "chars": 7465,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ad"
  },
  {
    "path": "jsonutils/adapters/registry_test.go",
    "chars": 18124,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ad"
  },
  {
    "path": "jsonutils/adapters/stdlib/doc.go",
    "chars": 318,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/adapter.go",
    "chars": 2113,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/adapter_test.go",
    "chars": 1725,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/doc.go",
    "chars": 198,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/lexer.go",
    "chars": 4924,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/lexer_test.go",
    "chars": 4196,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/ordered_map.go",
    "chars": 4796,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/ordered_map_test.go",
    "chars": 3647,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/pool.go",
    "chars": 2467,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/register.go",
    "chars": 570,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/writer.go",
    "chars": 1204,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/stdlib/json/writer_test.go",
    "chars": 1182,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/README.md",
    "chars": 9476,
    "preview": "# benchmarks\n\nDisclaimer: `go-openapi` has no affiliation with the providers of the tested libraries.\n\nCredits: the defi"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/benchmarks_test.go",
    "chars": 3328,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage be"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/large.json",
    "chars": 1940472,
    "preview": "{\"tree\":{\"name\":\"/\",\"kids\":[{\"name\":\"go\",\"kids\":[{\"name\":\"src\",\"kids\":[{\"name\":\"pkg\",\"kids\":[{\"name\":\"exp\",\"kids\":[{\"nam"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/large_sample.json",
    "chars": 28118,
    "preview": "{\"users\":[{\"id\":-1,\"username\":\"system\",\"avatar_template\":\"/user_avatar/discourse.metabase.com/system/{size}/6_1.png\"},{\""
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/medium_sample.json",
    "chars": 2070,
    "preview": "{\n\t\"person\": {\n\t  \"id\": \"d50887ca-a6ce-4e59-b89f-14f0b5d03b03\",\n\t  \"name\": {\n\t\t\"fullName\": \"Leonid Bugaev\",\n\t\t\"givenName"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/small.json",
    "chars": 13024,
    "preview": "{\n  \"statuses\": [\n    {\n      \"coordinates\": null,\n      \"favorited\": false,\n      \"truncated\": false,\n      \"created_at"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/small_sample.json",
    "chars": 144,
    "preview": "{\"st\": 1,\"sid\": 486,\"tt\": \"active\",\"gr\": 0,\"uuid\": \"de305d54-75b4-431b-adb2-eb6b9e546014\",\"ip\": \"127.0.0.1\",\"ua\": \"user_"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/fixtures/tiny.json",
    "chars": 83,
    "preview": "{\"hashtags\":[{\"indices\":[5, 10],\"text\":\"some-text\"}],\"urls\":[],\"user_mentions\":[]}\n"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/go.mod",
    "chars": 970,
    "preview": "module github.com/go-openapi/swag/jsonutils/adapters/testintegration/benchmarks\n\nrequire (\n\tgithub.com/go-openapi/swag/j"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/go.sum",
    "chars": 1098,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/payloads.go",
    "chars": 2602,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage be"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/payloads_easyjson.go",
    "chars": 14757,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage be"
  },
  {
    "path": "jsonutils/adapters/testintegration/benchmarks/payloads_test.go",
    "chars": 2284,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage be"
  },
  {
    "path": "jsonutils/adapters/testintegration/doc.go",
    "chars": 225,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/adapters/testintegration/go.mod",
    "chars": 944,
    "preview": "module github.com/go-openapi/swag/jsonutils/adapters/testintegration\n\nrequire (\n\tgithub.com/go-openapi/swag/jsonutils v0"
  },
  {
    "path": "jsonutils/adapters/testintegration/go.sum",
    "chars": 1098,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "jsonutils/adapters/testintegration/ifaces.go",
    "chars": 372,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage te"
  },
  {
    "path": "jsonutils/adapters/testintegration/integration_suite_test.go",
    "chars": 6132,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage te"
  },
  {
    "path": "jsonutils/adapters/testintegration/integration_test.go",
    "chars": 1480,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage te"
  },
  {
    "path": "jsonutils/adapters/testintegration/mocks_test.go",
    "chars": 4198,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Code ge"
  },
  {
    "path": "jsonutils/concat.go",
    "chars": 2283,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/concat_test.go",
    "chars": 3767,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/doc.go",
    "chars": 257,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/examples_test.go",
    "chars": 2874,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/fixtures_test/doc.go",
    "chars": 222,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "jsonutils/fixtures_test/go.mod",
    "chars": 203,
    "preview": "module github.com/go-openapi/swag/jsonutils/fixtures_test\n\nrequire (\n\tgithub.com/go-openapi/testify/enable/yaml/v2 v2.5."
  },
  {
    "path": "jsonutils/fixtures_test/go.sum",
    "chars": 754,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "jsonutils/fixtures_test/harness.go",
    "chars": 7395,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "jsonutils/fixtures_test/harness_test.go",
    "chars": 1898,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage fi"
  },
  {
    "path": "jsonutils/fixtures_test/ordered_fixtures.yaml",
    "chars": 3997,
    "preview": "#\n# Common test cases used by JSON and YAML utilities.\n#\n# For each test case, we provide both JSON and YAML versions.\nt"
  },
  {
    "path": "jsonutils/go.mod",
    "chars": 555,
    "preview": "module github.com/go-openapi/swag/jsonutils\n\nrequire (\n\tgithub.com/go-openapi/swag/conv v0.26.0\n\tgithub.com/go-openapi/s"
  },
  {
    "path": "jsonutils/go.sum",
    "chars": 754,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "jsonutils/json.go",
    "chars": 4080,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/json_test.go",
    "chars": 5118,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/ordered_map.go",
    "chars": 3113,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils/ordered_map_test.go",
    "chars": 6067,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage js"
  },
  {
    "path": "jsonutils_iface.go",
    "chars": 2169,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "jsonutils_iface_test.go",
    "chars": 1430,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "loading/doc.go",
    "chars": 214,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "loading/errors.go",
    "chars": 324,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/fixtures/petstore_fixture.json",
    "chars": 3023,
    "preview": "{\"swagger\":\"2.0\",\"info\":{\"version\":\"1.0.0\",\"title\":\"Swagger Petstore\",\"description\":\"A sample API that uses a petstore a"
  },
  {
    "path": "loading/fixtures/petstore_fixture.yaml",
    "chars": 3755,
    "preview": "swagger: '2.0'\ninfo:\n  version: '1.0.0'\n  title: Swagger Petstore\n  description: A sample API that uses a petstore as an"
  },
  {
    "path": "loading/go.mod",
    "chars": 728,
    "preview": "module github.com/go-openapi/swag/loading\n\nrequire (\n\tgithub.com/go-openapi/swag/yamlutils v0.26.0\n\tgithub.com/go-openap"
  },
  {
    "path": "loading/go.sum",
    "chars": 754,
    "preview": "github.com/go-openapi/testify/enable/yaml/v2 v2.5.0 h1:3hZD1fwydvCx/cc1R2uYNQirHqf2s6lqpKV3FcNTURA=\ngithub.com/go-openap"
  },
  {
    "path": "loading/json.go",
    "chars": 639,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/json_test.go",
    "chars": 1177,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/loading.go",
    "chars": 5243,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/loading_test.go",
    "chars": 12773,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/options.go",
    "chars": 2674,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/serve_test.go",
    "chars": 2112,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/yaml.go",
    "chars": 891,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading/yaml_test.go",
    "chars": 1169,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage lo"
  },
  {
    "path": "loading_iface.go",
    "chars": 3172,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "loading_iface_test.go",
    "chars": 3876,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "mangling/BENCHMARK.md",
    "chars": 4153,
    "preview": "# Benchmarking name mangling utilities\n\n```bash\ngo test -bench XXX -run XXX -benchtime 30s\n```\n\n## Benchmarks at `b3e7a5"
  },
  {
    "path": "mangling/doc.go",
    "chars": 1010,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "mangling/fuzz_test.go",
    "chars": 1782,
    "preview": "// SPDX-FileCopyrightText: Copyright (c) 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackag"
  },
  {
    "path": "mangling/go.mod",
    "chars": 103,
    "preview": "module github.com/go-openapi/swag/mangling\n\nrequire github.com/go-openapi/testify/v2 v2.5.0\n\ngo 1.25.0\n"
  },
  {
    "path": "mangling/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "mangling/initialism_index.go",
    "chars": 7163,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/initialism_index_test.go",
    "chars": 2998,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/name_lexem.go",
    "chars": 4308,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/name_lexem_test.go",
    "chars": 1522,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/name_mangler.go",
    "chars": 10802,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/name_mangler_benchmark_test.go",
    "chars": 1074,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/name_mangler_test.go",
    "chars": 13742,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/options.go",
    "chars": 4428,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/pools.go",
    "chars": 2028,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/split.go",
    "chars": 9884,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/split_test.go",
    "chars": 6040,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/string_bytes.go",
    "chars": 320,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/testdata/fuzz/FuzzToGoName/3e4b026d1078ac6b",
    "chars": 32,
    "preview": "go test fuzz v1\nstring(\"TTLss\")\n"
  },
  {
    "path": "mangling/util.go",
    "chars": 2162,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling/util_test.go",
    "chars": 2890,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ma"
  },
  {
    "path": "mangling_iface.go",
    "chars": 2800,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "mangling_iface_test.go",
    "chars": 1584,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "netutils/doc.go",
    "chars": 191,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "netutils/go.mod",
    "chars": 103,
    "preview": "module github.com/go-openapi/swag/netutils\n\nrequire github.com/go-openapi/testify/v2 v2.5.0\n\ngo 1.25.0\n"
  },
  {
    "path": "netutils/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "netutils/net.go",
    "chars": 711,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ne"
  },
  {
    "path": "netutils/net_test.go",
    "chars": 769,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage ne"
  },
  {
    "path": "netutils_iface.go",
    "chars": 400,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "netutils_iface_test.go",
    "chars": 492,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  },
  {
    "path": "stringutils/collection_formats.go",
    "chars": 1662,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage st"
  },
  {
    "path": "stringutils/collection_formats_test.go",
    "chars": 1831,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage st"
  },
  {
    "path": "stringutils/doc.go",
    "chars": 200,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\n// Package"
  },
  {
    "path": "stringutils/go.mod",
    "chars": 106,
    "preview": "module github.com/go-openapi/swag/stringutils\n\nrequire github.com/go-openapi/testify/v2 v2.5.0\n\ngo 1.25.0\n"
  },
  {
    "path": "stringutils/go.sum",
    "chars": 183,
    "preview": "github.com/go-openapi/testify/v2 v2.5.0 h1:UOCr63aAsMIDydZbZGqo5Ev01D4eydItRbekDuZMJLw=\ngithub.com/go-openapi/testify/v2"
  },
  {
    "path": "stringutils/strings.go",
    "chars": 630,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage st"
  },
  {
    "path": "stringutils/strings_test.go",
    "chars": 935,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage st"
  },
  {
    "path": "stringutils_iface.go",
    "chars": 1169,
    "preview": "// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers\n// SPDX-License-Identifier: Apache-2.0\n\npackage sw"
  }
]

// ... and 23 more files (download for full content)

About this extraction

This page contains the full source code of the go-openapi/swag GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 223 files (2.4 MB), approximately 650.9k tokens, and a symbol index with 940 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!