Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Allow field's spec properties #94

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

Conversation

Garito
Copy link

@Garito Garito commented Aug 12, 2019

Hi!
I created a small patch to allow OpenAPI spec properties besides extensions:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#schema-object

Please let me know if the code is good enough so I can add testing to it

Thanks

@s-knibbs
Copy link
Owner

I should explain that I only defined the generic keywords on JsonSchemaMeta which apply to any type.

The other keywords such as pattern, maximum and minimum only apply to specific types and are better handled via the type system. There's an example that makes use of pattern by using a NewType.

I've also created #95 to look at supporting python sets which would make use of uniqueItems.

@Garito
Copy link
Author

Garito commented Aug 13, 2019

Yeah, I've seen it
I've done one for the mongo's ObjectId, Email etc
The question is, for me, how to parametrize it (maximum example)

@s-knibbs
Copy link
Owner

Maybe if you could provide an example? You can pass parameters to the field encoders though, the decimal field allows you to specify the decimal precision for example.

@Garito
Copy link
Author

Garito commented Aug 17, 2019

Should I create a FileEncoder for all the native fields then?
Every numeric type needs to allow to specify maximum and minimum, for instance
I don't understand where the confusion is, sorry

@Garito
Copy link
Author

Garito commented Aug 21, 2019

So, what is going to be?
How do you think we should deal with a number field with minimum 0 maximum 150?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants