Skip to content

Fix header deserialization in V2 documents - #261

Merged
Darrel (darrelmiller) merged 5 commits into
masterfrom
dm/fix-schema-v2
May 20, 2018
Merged

Darrel (darrelmiller) merged 5 commits into
masterfrom
dm/fix-schema-v2

Conversation

@darrelmiller

Copy link
Copy Markdown
Member

Several fields were not supported and some were supported that don't exist in V2. I also re-ordered the parsing code to match the spec order.

case "multi":
h.Style = ParameterStyle.Form;
h.Explode = true;
return;

@PerthCharern PerthCharern May 18, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"multi" is now allowed in the header in V2 spec. Looks like it's only allowed in Param. #Closed

@PerthCharern PerthCharern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@PerthCharern

PerthCharern commented May 18, 2018 •

Copy link
Copy Markdown
Contributor

collectionFormat: csv

Can we add enum here as well? It's a bit different than other fields and is worth testing. #Closed


Refers to: test/Microsoft.OpenApi.Readers.Tests/V2Tests/Samples/OpenApiParameter/headerParameter.yaml:11 in bed9b57. [](commit_id = bed9b57, deletion_comment = False)

return header;
}

private static void LoadStyle(OpenApiHeader h, string v)

@PerthCharern PerthCharern May 18, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we use full word here? header and format instead of h and v.

return;
case "tsv":
throw new NotSupportedException();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

} [](start = 9, length = 4)

Looks like we should throw an error for case default? That would indicate that the document is broken in V2.

@darrelmiller
Darrel (darrelmiller) merged commit b94c307 into master May 20, 2018
@darrelmiller
Darrel (darrelmiller) deleted the dm/fix-schema-v2 branch May 20, 2018 17:05
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