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

feat: adds odata metadata to entity type #74

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions examples/TripPin.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,19 @@
"title": "City",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"CountryRegion": {
"type": "string"
},
Expand Down Expand Up @@ -3253,6 +3266,19 @@
"title": "Location",
Copy link
Contributor Author

@snebjorn snebjorn May 3, 2020

Choose a reason for hiding this comment

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

@ralfhandl Also need a bit of help here. When I run test.cmd I get this error. It makes no sense to me.

odata-rw-v3
lexical error: invalid char in json text.
                                        {"swagger":"2.0","info":{"titl
                     (right here) ------^
lexical error: invalid char in json text.
                                        {"openapi":"3.0.0","info":{"ti
                     (right here) ------^
TripPin
lexical error: invalid char in json text.
                                        {"swagger":"2.0","info":{"titl
                     (right here) ------^
lexical error: invalid char in json text.
                                        {"openapi":"3.0.0","info":{"ti
                     (right here) ------^

As a result the json files are empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ralfhandl do you have any clue why this is happening?

Copy link
Contributor

Choose a reason for hiding this comment

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

The only cause I can think of is that test.cmd only works if called from within the tools folder.

Note that the XSLT and the JS versions are not in sync and have their own set of test inputs and expected outputs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a suspisseion this has something to do with CRLF and LF line endings.

I changed autocrlf = true to autocrlf = input a while ago and this problem started happening when I merged master in.
Also the CI doesn't seem to have this problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have autocrlf = false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FML..... it was caused by a missing " in a xsl:text block

"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"Address": {
"type": "string"
},
Expand Down Expand Up @@ -3316,6 +3342,19 @@
"title": "EventLocation",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"Address": {
"type": "string"
},
Expand Down Expand Up @@ -3364,6 +3403,19 @@
"title": "AirportLocation",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"Address": {
"type": "string"
},
Expand Down Expand Up @@ -3409,6 +3461,19 @@
"title": "Photo",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"Id": {
"anyOf": [
{
Expand Down Expand Up @@ -3451,6 +3516,19 @@
"title": "Person",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"UserName": {
"type": "string"
},
Expand Down Expand Up @@ -3602,6 +3680,19 @@
"title": "Airline",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"AirlineCode": {
"type": "string"
},
Expand Down Expand Up @@ -3632,6 +3723,19 @@
"title": "Airport",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"IcaoCode": {
"type": "string"
},
Expand Down Expand Up @@ -3677,6 +3781,19 @@
"title": "PlanItem",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"PlanItemId": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -3792,6 +3909,19 @@
"title": "PublicTransportation",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"PlanItemId": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -3910,6 +4040,19 @@
"title": "Flight",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"PlanItemId": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -4037,6 +4180,19 @@
"title": "Event",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"PlanItemId": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -4146,6 +4302,19 @@
"title": "Trip",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"TripId": {
"type": "integer",
"format": "int32"
Expand Down
26 changes: 26 additions & 0 deletions examples/annotations.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,19 @@
"title": "SinglePartKey",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"ID": {
"type": "string"
},
Expand Down Expand Up @@ -2967,6 +2980,19 @@
"title": "TwoPartKey",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"One": {
"type": "integer",
"format": "int32"
Expand Down
13 changes: 13 additions & 0 deletions examples/authorization.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,19 @@
"title": "Person",
"type": "object",
"properties": {
"@odata.etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@odata.id": {
"readOnly": true,
"type": "string"
},
"@odata.type": {
"readOnly": true,
"type": "string"
},
"ID": {
"type": "string"
},
Expand Down
52 changes: 52 additions & 0 deletions examples/containment.openapi3.json
Original file line number Diff line number Diff line change
Expand Up @@ -4889,6 +4889,19 @@
"title": "Whole",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"ID": {
"type": "string"
},
Expand Down Expand Up @@ -4956,6 +4969,19 @@
"title": "Part",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"index": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -5035,6 +5061,19 @@
"title": "SubPart",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"One": {
"type": "integer",
"format": "int32"
Expand Down Expand Up @@ -5071,6 +5110,19 @@
"title": "Folder",
"type": "object",
"properties": {
"@etag": {
"example": "W/\"08D7D40891852C76\"",
"readOnly": true,
"type": "string"
},
"@id": {
"readOnly": true,
"type": "string"
},
"@type": {
"readOnly": true,
"type": "string"
},
"Name": {
"type": "string"
},
Expand Down
Loading