Azure / Azure/azure-functions-openapi-extension

References in nested schema do not match naming strategy

Open
#688 0 comments 0 reactions 0 assignees View on GitHub
feature: api-description Needs: Triage (Functions) potential-bug
Dominant language
C#
Stars
388
Forks
202
PR merge metrics
No merged PRs in 30d

Description

### Description

When creating schema definitions with `ToOpenApiSchemas` the "$ref" paths do not use the provided `CamelCaseNamingStrategy`.

Expected:
```yaml
definitions:
foo:
type: object
properties:
bar:
$ref: '#/definitions/bar'
bar:
type: object
properties:
data:
type: string
```

Actual:
```yaml
definitions:
foo:
type: object
properties:
bar:
$ref: '#/definitions/Bar'
bar:
type: object
properties:
data:
type: string
```

This causes issues when validating the swagger document.

### Steps to reproduce

Sample project to come

Contributor guide

Open the contributing guide

Research direction

No source file or test is named; start from the ToOpenApiSchemas call described in the issue and reproduce the nested schema output with CamelCaseNamingStrategy. Compare the generated $ref paths with the definition names, then verify that the resulting Swagger document validates and matches the expected YAML.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, openapi
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.