Skip to content
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

Incorrect path for multi-part keys (composite keys) #42

Open
snebjorn opened this issue Aug 8, 2019 · 2 comments
Open

Incorrect path for multi-part keys (composite keys) #42

snebjorn opened this issue Aug 8, 2019 · 2 comments

Comments

@snebjorn
Copy link

snebjorn commented Aug 8, 2019

I believe the property name is required for multi-part keys.
See https://stackoverflow.com/a/12510062/1220627

Currently paths are generated without property names regardless.

Current

{
  "swagger": "2.0",
  // ...omitted
  "paths": {
    "/FooSet('{fooId}')": {
      // ...omitted
    },
    "/MultiKeySet('{fooId}','{barId}')": {
      // ...omitted
    }
  }
}

Correct swagger for OData

{
  "swagger": "2.0",
  // ...omitted
  "paths": {
    "/FooSet('{fooId}')": {
      // ...omitted
    },
    "/MultiKeySet(fooId='{fooId}',barId='{barId}')": {
      // ...omitted
    }
  }
}
@jhorbulyk
Copy link
Contributor

My observation has been that the property name is only required for versions of OData prior to version 4 and that in version 4, these fields become optional.

@snebjorn
Copy link
Author

snebjorn commented Sep 2, 2019

That could be the case. I'm consuming a version 2 OData api.

Does this tool only support v4?
Never the less, if they're optional in v4 adding the property names would enable backwards compatibility :)

BTW are you aware of this https://github.com/oasis-tcs/odata-openapi? It seems like an official tool for converting CSDL to OpenAPI. While it's a bit complicated to run it does a very good job. Perhaps this tool could use that for conversion but make it simple to run via Node. Than all the conversion edge cases are handled by the OData team them self - seems like a win/win :)

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

No branches or pull requests

2 participants