Skip to content

Documented how OpenAPI references are used #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

darrelmiller
Copy link
Contributor

No description provided.

Copy link
Contributor

Learn Build status updates of commit dc3380f:

⚠️ Validation status: warnings

File Status Preview URL Details
OpenAPI/OpenAPI.NET/references-openapi.md ⚠️Warning Details

OpenAPI/OpenAPI.NET/references-openapi.md

  • Line 4, Column 9: [Warning: author-not-found - See documentation] Invalid value for author: 'darrmi' is not a valid GitHub ID.
  • Line 2, Column 1: [Suggestion: ms-date-missing - See documentation] Missing required attribute: 'ms.date'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit f313a60:

⚠️ Validation status: warnings

File Status Preview URL Details
OpenAPI/OpenAPI.NET/references-openapi.md ⚠️Warning Details

OpenAPI/OpenAPI.NET/references-openapi.md

  • Line 4, Column 9: [Warning: author-not-found - See documentation] Invalid value for author: 'darrmi' is not a valid GitHub ID.
  • Line 2, Column 1: [Suggestion: ms-date-missing - See documentation] Missing required attribute: 'ms.date'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit 69f97c4:

⚠️ Validation status: warnings

File Status Preview URL Details
OpenAPI/OpenAPI.NET/references-openapi.md ⚠️Warning Details

OpenAPI/OpenAPI.NET/references-openapi.md

  • Line 4, Column 9: [Warning: author-not-found - See documentation] Invalid value for author: 'darrmi' is not a valid GitHub ID.
  • Line 2, Column 1: [Suggestion: ms-date-missing - See documentation] Missing required attribute: 'ms.date'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit b89b424:

⚠️ Validation status: warnings

File Status Preview URL Details
OpenAPI/OpenAPI.NET/references-openapi.md ⚠️Warning Details

OpenAPI/OpenAPI.NET/references-openapi.md

  • Line 4, Column 9: [Warning: author-not-found - See documentation] Invalid value for author: 'darrmi' is not a valid GitHub ID.
  • Line 2, Column 1: [Suggestion: ms-date-missing - See documentation] Missing required attribute: 'ms.date'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit c2b8bfc:

⚠️ Validation status: warnings

File Status Preview URL Details
OpenAPI/OpenAPI.NET/references-openapi.md ⚠️Warning Details

OpenAPI/OpenAPI.NET/references-openapi.md

  • Line 4, Column 9: [Warning: author-not-found - See documentation] Invalid value for author: 'darrmi' is not a valid GitHub ID.
  • Line 2, Column 1: [Suggestion: ms-date-missing - See documentation] Missing required attribute: 'ms.date'.

For more details, please refer to the build report.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@darrelmiller darrelmiller marked this pull request as ready for review April 23, 2025 16:22
@darrelmiller darrelmiller requested a review from a team as a code owner April 23, 2025 16:22
For completeness, Reference Objects can also point to targets in a JSON/YAML document that contain properly formed OpenAPI objects, but is not a complete OpenApi document. We refer to these as OpenAPI "fragments". Currently OpenAPI.NET does not support referencing OpenAPI fragments.

```yaml
openapi: 3.1.0
Copy link
Member

Choose a reason for hiding this comment

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

@MaggieKimani1 I believe this one is missing from your test suite

components:
schemas:
specialitem: # Use the item type but provide a different title for the type
title: Special Item
Copy link
Member

Choose a reason for hiding this comment

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

sanity check here, should this demonstrate the summary or description property instead? I was under the impression those were the only two overridable properties through ref. But it might be true for anything BUT JSON schema references.
If JSON schema references allow more properties to be overridden, we do have to implement a bunch of changes in the models.

- 'null'
properties:
b:
$ref: '#/properties/b'
Copy link
Member

Choose a reason for hiding this comment

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

this one looks odd to me, if I go "up one schema" I end up in the schema definition of b, which does not contain any b property. Maybe I'm using the wrong "resolving routine", in which case I believe we should document the routine one should apply here.

additionalProperties: false
properties:
b:
$ref: '#/properties/d'
Copy link
Member

Choose a reason for hiding this comment

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

assuming the routine to apply here is "go find the closed defined id in the parents, and start resolving from there"? we should detail that information.

additionalProperties: false
properties:
c:
$id: 'http://example.org/c'
Copy link
Member

Choose a reason for hiding this comment

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

@MaggieKimani1 I believe we're missing this one in the test cases

### What can a JSON Schema locator reference target

- An internal component
- An interal component subschema
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- An interal component subschema
- An internal component subschema

content:
application/json:
schema:
$ref: 'OAS-schemas.yaml#/components/schemas/person'
Copy link
Member

Choose a reason for hiding this comment

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

in terms of URI here, what conventions can be applied?
is this equivalent to having ./ in front? What about / in front? Do we have an RFC we can leverage here?

content:
application/json:
schema:
$ref: 'https://schemas.acme.org/address'
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming this is based on URI conventions. If the id was /address, it'd have been equivalent. But if it were ./address the ref should have been https://schema.acme.org/person/address ?

Maybe worth calling out even if we don't implement it/fully spec it yet.

paths:
/jobs/{id}:
get:
$ref: '#/components/pathItems/job'
Copy link
Member

Choose a reason for hiding this comment

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

is this indented properly? shouldn't it be that?

Suggested change
$ref: '#/components/pathItems/job'
$ref: '#/components/pathItems/job'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants