Open-Cap-Format-OCF icon indicating copy to clipboard operation
Open-Cap-Format-OCF copied to clipboard

Removed maxLength limit for subdivision and updated description

Open arthur-clara opened this issue 1 year ago • 9 comments

What type of PR is this?

/kind feature

What this PR does / why we need it:

Updates the subdivision schema to remove the limitation to match ISO 3166-2 to allow subdivisions with more than two digits.

Which issue(s) this PR fixes:

Fixes #442

arthur-clara avatar Mar 26 '24 12:03 arthur-clara

For some context, the ISO codes don't map cleanly to specific jurisdictions that relevant for the purposes of startup financings - e.g. Abu Dhabi and UK where separate subdivisions are relevant. @arthur-clara, can you add that example you used in detail? Would be good to have documented somewhere for reference.

JSv4 avatar Mar 26 '24 16:03 JSv4

We're thinking that we need to separately handle subdivision name and subdivision code or some kind of split to handle ISO codes where they're of sufficient fidelity but capture finer grains where we need to. We could also use JSON Schema conditional validation to have special rules for certain countries.

JSv4 avatar Mar 26 '24 16:03 JSv4

Per discussion on 6/20/24, we can use two properties here - one for codes (for US states) and one for name (where ISO codes don't make sense). Issuer and address schema would be impacted as they both reference the modified type.

JSv4 avatar Jun 20 '24 16:06 JSv4

@JSv4 Per the discussion, I have reverted the subdivisionCode schema to remove and changes and added in a new object subdivisionName that is free text. I have also added "jurisdiction_of_formation" to the ISSUER object which can be used when the subdivision code does not work.

I am having an issue with the PR though because the generate docs step is failing for me and I am not sure why.

arthur-clara avatar Aug 15 '24 15:08 arthur-clara

@arthur-clara to add a oneOf validation

JSv4 avatar Aug 15 '24 16:08 JSv4

@JSv4

I was finally looking at implementing the oneOf validation but I realized this would be a breaking change.

Right now, the country address type includes an optional country_subdivision property which points to the CountrySubdivisionCode schema.

I am adding country_subdivision_name property to address which points to a new CountrySubdivisionName schema

However, if I add the oneOf validation, it means that we now require country_subdivision or country_subdivision_name which I believe is a breaking change.

Are we okay with that or am I being obtuse and missing something?

arthur-clara avatar Oct 10 '24 15:10 arthur-clara

Makes sense. I say we call this. Becoming the longest little quick PR in all the known universe :-).

JSv4 avatar Oct 10 '24 15:10 JSv4

Can I just add the country_subdivision_name as an optional to the address schema so that we can accommodate non-US?

Actually...it isn't in the address. It is in the Issuer that is the issue. country_subdivision_of_formation.

arthur-clara avatar Oct 10 '24 15:10 arthur-clara

@arthur-clara this might be an approach to enforce a oneof for multiple optional values https://stackoverflow.com/questions/60403128/json-schema-oneof-without-required

lavens avatar Oct 10 '24 16:10 lavens