openapi: support validation attributes
Closes #1055
QUALITY CHECKLIST
- [ ] Changes implemented in code
- [ ] Complies with our contributing guidelines
- [ ] Adapted tests
- [ ] Documentation updated
@bkoelman could you give a preliminary review on just that?
@verdie-g Do you still intend to complete this?
Unfortunately I don't think I'll find the time.
I pushed some old changes that were still on my machine in case someone wants to continue the PR.
Hi @bkoelman, I'll try finishing that PR. Could you have a pass on its current state, I'll add tests for Kiota once the one for NSwag start looking okay. Also, is there anything worth adding to the doc regarding this change?
Hi @bkoelman, I'll try finishing that PR. Could you have a pass on its current state, I'll add tests for Kiota once the one for NSwag start looking okay. Also, is there anything worth adding to the doc regarding this change?
Cool! Sure, I'll take a look. I don't expect the docs need to be updated, unless there are pitfalls users should know about. For kiota, it's worth removing the --log-level Error switch temporarily to see what comes up. However, kiota is pretty rigid and inflexible, so don't worry too much about its quirks.
I'll resume the work in a few days
I've completed the table except the EF Core column which I think is out-of-scope for this PR.
For kiota, it's worth removing the --log-level Error switch temporarily to see what comes up.
#/paths/~1socialMediaAccounts/post/responses/201/headers/Location/schema - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/creditCard - The format credit-card is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/email - The format email is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/phone - The format tel is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/profilePicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/backgroundPicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPatchRequest/properties/nextRevalidation - The format date-span is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/creditCard - The format credit-card is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/email - The format email is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/phone - The format tel is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/profilePicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/backgroundPicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInPostRequest/properties/nextRevalidation - The format date-span is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/creditCard - The format credit-card is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/email - The format email is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/phone - The format tel is not supported by Kiota for the type string and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/profilePicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/backgroundPicture - The format uri is not supported by Kiota and the string type will be used.
#/components/schemas/socialMediaAccountAttributesInResponse/properties/nextRevalidation - The format date-span is not supported by Kiota for the type string and the string type will be used.
Kiota doesn't support the formats uri and date-span :/
I've completed the table except the EF Core column which I think is out-of-scope for this PR.
I've mentioned earlier that the goal of writing end-to-end tests is to assess the overall experience our users will face. This doesn't mean we need to write tests for EF Core features in this PR, but we do need to check for oddities and possibly create separate issues to address them, or document things to watch out for. So I disagree that it's out of scope. Otherwise, I wouldn't have added the EF Core column in the first place.
Here is the single SQL statement to create the table
CREATE TABLE "SocialMediaAccounts" (
"Id" uuid NOT NULL,
"AlternativeId" uuid,
"FirstName" text,
"LastName" text NOT NULL,
"UserName" character varying(18),
"CreditCard" text,
"Email" text,
"Password" text,
"Phone" text,
"Age" double precision,
"ProfilePicture" text,
"BackgroundPicture" text,
"Tags" text[],
"CountryCode" text,
"Planet" text,
"NextRevalidation" interval,
"ValidatedAt" timestamp with time zone,
"ValidatedAtDate" date,
"ValidatedAtTime" time without time zone,
CONSTRAINT "PK_SocialMediaAccounts" PRIMARY KEY ("Id")
);
I've updated the table accordingly.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.30%. Comparing base (
459ced3) to head (54fedf2).
Additional details and impacted files
@@ Coverage Diff @@
## openapi #1477 +/- ##
========================================
Coverage 91.30% 91.30%
========================================
Files 396 396
Lines 12834 12834
Branches 2028 2028
========================================
Hits 11718 11718
Misses 725 725
Partials 391 391
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The table update isn't correct. The Y/N columns need to move.
The same applies to: [Compare], [AllowedValues], [DeniedValues], [Remote], and [ValidateNever].
The Y/N columns need to move.
I used N to specify that it's not supported. I can use - instead.
Both (remove culture and change assertions) haven't been addressed yet.
I'm not able to access the comment to answer but I could you clarify what you are expecting here.
Both (remove culture and change assertions) haven't been addressed yet.
I'm not able to access the comment to answer but I could you clarify what you are expecting here.
Using the dollar sign and putting literal values in there, so it becomes culture-insensitive.