Comments (5)
@pimterry do you have a view, as you're closer to these APIs than I am?
from aws2openapi.
Interesting, yes this is definitely an artefact of our spec generation.
We build these parameters by looking at the paginators file for the API, getting the parameter names from there, and adding them to the list of params if they're not already present. They are already present though, clearly, but mismatched because the locationName
of these params (which should be the name they're sent under) is in camelCase for some reason. Not clear why.
The actual spec for this endpoint (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSpotFleetRequests.html) does list them as MaxResults and NextToken though, so perhaps uppercase is the correct format, and locationName
isn't being used as I thought here.
I think there's a couple of possible options:
- Maybe the API does actually accept both. We could include both, or pick one format and stick to it. As far as I know, there's no way to define case-insensitive parameter names with OpenAPI (unless you know better @MikeRalphson?). If we want to pick only one, I'd lean towards using the publicly documented format (TitleCase).
- Maybe the API actually only accepts one, and our parsing is wrong. That'd mean either:
- We're misunderstanding how the param is really sent, and
locationName
isn't being used here (i.e. the real param is uppercase) - We're misunderstanding how the paginators file is used, and the names there refer to param keys in the input shape, not the query param names (i.e. the real param is lowercase, and the docs are wrong/confusing).
- We're misunderstanding how the param is really sent, and
I'm going to dig into it, hopefully later today, and try to work out which of those cases this is. Any ideas in the meantime very welcome!
from aws2openapi.
Thanks! As you suspect, there's no way to indicate case-insensitive parameter name matching in OAS.
from aws2openapi.
Ok, conclusion:
- The param is indeed supposed to be TitleCase.
- We were interpreting the parameter spec wrong. The
ec2
protocol does use the same mechanism for query serialization as thequery
protocol, but has a bonus special case for parameter naming: https://github.com/aws/aws-sdk-js/blob/master/lib/query/query_param_serializer.js#L10-L16 - I've opened #20, which fixes this by generating names that do follow this bonus rule. Just generating the names correctly fixes the issue, as the pagination logic now correctly spots that the parameter already exists.
Thanks for reporting this @ggallotti! It applies to all the other EC2 params too, so it's actually a general issue with the EC2 specs that I'd totally missed 👍
from aws2openapi.
Great!
Thanks both for your time at resolving this Issue.
from aws2openapi.
Related Issues (20)
- Duplicate Operation Paging Parameters in S3
- The info.contact.x-twitter field causes openapi-generator to fail HOT 7
- The "members" attribute in the AWS service definition is literally a list of "member" objects HOT 7
- Add tests using moto and pyopenapi HOT 6
- Unexpected "get" requests in generated openapi spec HOT 2
- text/xml in iam spec instead of application/xml, which is what the OpenAPI 3.0 spec supports HOT 3
- The "operationId" field shouldn't have spaces HOT 2
- Converter missing response mappings HOT 1
- x-amz-meta- is wrong for AWS S3 PutObject API HOT 1
- Body in PutObject, UploadPart API's type should by string instead of object HOT 2
- Wrong error response for HeadObject in s3 HOT 3
- S3 API's error not handled correctly HOT 1
- Incorrect usage of additional properties besides $ref for EC2 OpenAPI3 Swagger file HOT 1
- Openapi for endpoints that have pagination end up with duplicate parameters HOT 1
- Incorrect variable type defined in the yaml file
- unexpected multi-type 'allOff' references in runtime.lex.v2 spec
- Query parameters array "serialization" strategy HOT 5
- Support signatureVersion: bearer
- Exception definitions not included
- Duplicate entries in Servers Object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws2openapi.