Skip to content

Commit 316b49d

Browse files
committed
Add discriminator and some other pull request feedback
1 parent bd3c10c commit 316b49d

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

specification/parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Parameters can reside in different locations, indicated by the `in` field. The m
7373
> **NOTE**:
7474
> If any parameters are `in: query`, then `in: querystring` cannot be used.
7575

76-
- `querystring` (OpenAPI 3.2+): The entire query string is treated as a single parameter with complex structure:
76+
- `querystring` (OpenAPI 3.2+): The entire query string is treated as a single parameter with complex structure, meaning that combinations of query parameters can be expressed using a well-defined Schema object:
7777

7878
```yaml
7979
paths:

upgrading/v3.1-to-v3.2.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ paths:
114114
### Advanced HTTP Method Support
115115

116116
- **QUERY method** for complex filtering with request bodies
117-
- **Custom HTTP methods** via additionalOperations
118-
- **Enhanced parameter handling** including querystring location
117+
- **Custom HTTP methods** via `additionalOperations`
118+
- **Enhanced parameter handling** including `in: querystring` location
119119

120120
*See: [HTTP Methods](../specification/http-methods) for implementation details*
121121

@@ -131,35 +131,25 @@ paths:
131131
### Security Enhancements
132132

133133
- **OAuth2 Device Authorization** flow for limited-input devices
134-
- **Enhanced metadata** support with oauth2MetadataUrl
134+
- **Enhanced metadata** support with `oauth2MetadataUrl`
135135
- **Deprecation marking** for security schemes
136136
- **URI-based references** for security schemes
137137

138138
*See: [Security](../specification/security) for updated authentication methods*
139139

140-
### Better Examples and Documentation
141-
142-
- **Structured examples** with dataValue field
143-
- **Serialization examples** with serializedValue field
144-
- **Enhanced servers** with name fields
145-
- **Document identity** with $self field
140+
### Discriminator Improvements
146141

147-
*See: [Providing Documentation and Examples](../specification/docs) for enhanced example handling*
142+
- **Use an optional value** for `discriminator`
143+
- **Provide fallback** configuration with `defaultMapping` for payloads that don't match the discriminator mapping
148144

149-
## Upgrade Benefits
150-
151-
## Gradual Enhancement Strategy
145+
### Better Examples and Documentation
152146

153-
Consider adopting new features incrementally:
147+
- **Structured examples** with `dataValue` field
148+
- **Serialization examples** with `serializedValue` field
149+
- **Enhanced servers** with `name` fields
150+
- **Document identity** with `$self` field
154151

155-
1. **Enhance server descriptions** - Add `name` fields to server objects
156-
2. **Improve examples** - Use `dataValue` and `serializedValue` for clearer examples
157-
3. **Add document identity** - Include `$self` field if URI resolution clarity is needed
158-
1. **Tag enhancements** - Convert `x-displayName` to `summary`, `x-tagGroups` to tag hierarchy
159-
2. **Remove custom extensions** - Replace with native 3.2 functionality where available
160-
1. **New HTTP methods** - Implement QUERY method for complex filtering scenarios
161-
2. **Streaming support** - Add sequential media types for real-time APIs
162-
3. **Enhanced security** - Implement OAuth2 device flow if relevant to your use cases
152+
*See: [Providing Documentation and Examples](../specification/docs) for enhanced example handling*
163153

164154
## Migration Checklist
165155

@@ -171,9 +161,10 @@ Consider adopting new features incrementally:
171161
### Gradual Enhancements (As Needed)
172162

173163
- [ ] Replace custom extensions with native 3.2 features
174-
- [ ] Add `name` fields to server objects for better identification
175-
- [ ] Enhance examples with `dataValue`/`serializedValue` fields
176164
- [ ] Consider tag hierarchy for better API organisation
165+
- [ ] Enhance examples with `dataValue`/`serializedValue` fields
166+
- [ ] Add `name` fields to server objects for better identification
167+
- [ ] Set a `defaultMapping` for discriminators to use a default schema rather than trigger an error
177168
- [ ] Evaluate new HTTP methods for relevant use cases
178169
- [ ] Review security schemes for OAuth2 device flow applicability
179170
- [ ] Consider sequential media types for streaming or real-time APIs

0 commit comments

Comments
 (0)