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

Add custom json formatter for format: date #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kMutagene
Copy link

See #240.

@sergey-tihon @Thorium I gave this a shot by adding a custom attribute if the format of a string in the schema is date.

I could not get the test projects to work locally, but i would guess i could add a controller to the swashbuckle webapi?

E.g. a UpdateDateOnlyController here https://github.com/fsprojects/SwaggerProvider/blob/master/tests/Swashbuckle.WebApi.Server/Controllers/UpdateControllers.fs

If you could give me guidance on where and how to add relevant tests that would be great.

@sergey-tihon
Copy link
Member

Thank you for this PR @kMutagene.

but i would guess i could add a controller to the swashbuckle webapi?

yes, we need to find out how to create a controller that emits schema with such a date-time format.

E.g. a UpdateDateOnlyController here

Yes, you can create a new one for date-time special cases or use SpecialCasesControllers.fs

If you could give me guidance on where and how to add relevant tests that would be great.

The simplest option is to extend SpecialCasesControllers.fs, and then add new test to Swashbuckle.SpecialCasesControllers.Tests.fs

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