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 string limit length of 255 #361

Merged
merged 3 commits into from Oct 16, 2019
Merged

Add string limit length of 255 #361

merged 3 commits into from Oct 16, 2019

Conversation

marie-x
Copy link
Collaborator

@marie-x marie-x commented Sep 19, 2019

Explain pull request

Per #348:

Is there a plan to add a field size limitation? For example, the device_id or vehicle_id could be limited in their number of characters.

Is this a breaking change

  • No, not breaking

Provider or agency

Which API(s) will this pull request impact:

  • agency

Additional context

Add any other context or screenshots about the feature request here.

@marie-x marie-x requested review from hunterowens, thekaveman and a team as code owners September 19, 2019 20:03
@marie-x marie-x self-assigned this Sep 19, 2019
@marie-x marie-x added the Agency Specific to the Agency API label Sep 19, 2019
@marie-x marie-x added this to the 0.4.0 milestone Sep 19, 2019
@sweis
Copy link
Contributor

sweis commented Sep 20, 2019

You could enforce this in the schema by using the "maxLength" validator. You'd update get_vehicle.json like this:

...
  "vehicle_id": {
      "$id": "#/properties/vehicle_id",
      "type": "string",
      "description": "The Vehicle Identification Number visible on the vehicle itself",
      "maxLength": 255,
      "default": "",
      "examples": [
        "ABC123"
      ],
      "pattern": "^(.*)$"
    },
...

See here for examples:
https://json-schema.org/understanding-json-schema/reference/string.html#length

@marie-x
Copy link
Collaborator Author

marie-x commented Sep 20, 2019

Good call @sweis. Adding.

also add previously missing status "trip"
@hunterowens
Copy link
Collaborator

this will be overwritten by the schema generator in all /schema directory. @Karcass - when you generate the schemas, you need to either the code / template schemas in that directory.

@hunterowens
Copy link
Collaborator

Hey @Karcass have you had a chance to update this using the appropriate schema/generate_schema.py process?

@hunterowens hunterowens merged commit 74adf97 into openmobilityfoundation:dev Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agency Specific to the Agency API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants