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

Validation/V1 Schema Megathread #27

Closed
thomasdavis opened this issue Dec 1, 2020 · 11 comments
Closed

Validation/V1 Schema Megathread #27

thomasdavis opened this issue Dec 1, 2020 · 11 comments

Comments

@thomasdavis
Copy link
Member

thomasdavis commented Dec 1, 2020

I just bumped the schema version to v1 which makes the registry functions have breaking changes.

There is going to be problems, therefore this mega thread.

All pre-existing PR's can still be merged.

Happy to answer and fix all problems, sorry for any inconveniences.

The v1 release of the schema commits to the idea that there won't be support for official backward incompatibilities -> jsonresume/resume-schema#372

@thomasdavis
Copy link
Member Author

CLI Problems -> jsonresume/resume-cli#441
Schema Problems -> jsonresume/resume-schema#372

@mbomfim33
Copy link

mbomfim33 commented Dec 29, 2020

@thomasdavis, just hit this block while testing this out for the first time (I must confess, this is the first time I have ever heard of a JSON Resume, and I love the idea):

JSON Resume
Resume json invalid - [{"code":"PATTERN","params":["^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$",""],"message":"String does not match pattern ^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$: ","path":"#/education/4/endDate","description":"e.g. 2014-06-29"}] - Please visit https://github.com/jsonresume/registry-functions/issues/27

I'm still studying at the university, thus my end-date for the institution is an empty string (see: "path":"#/education/4/endDate"). It seems the regex is not considering empty strings (it seems to consider the pattern only). If you or anyone else that works on this project is too busy I can try adding a rule for this, or is there any special reasons as to why empty strings are not allowed?

PS: Let me know if this is not the right channel to report this.

@Darkwater23
Copy link

Same error as @MarcoBomfim, but for a different reason. I went to school for a year, wasn't sure what do, stopped and then started again. That was 20 years ago for me. I don't list the start and end date for my schooling at all on LinkedIn, which is were I exported my JSON from. I'll try to get the dates in there to move forward, but thought I'd mention it.

@danshort
Copy link

@thomasdavis, just hit this block while testing this out for the first time (I must confess, this is the first time I have ever heard of a JSON Resume, and I love the idea):

JSON Resume
Resume json invalid - [{"code":"PATTERN","params":["^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$",""],"message":"String does not match pattern ^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$: ","path":"#/education/4/endDate","description":"e.g. 2014-06-29"}] - Please visit https://github.com/jsonresume/registry-functions/issues/27

I'm still studying at the university, thus my end-date for the institution is an empty string (see: "path":"#/education/4/endDate"). It seems the regex is not considering empty strings (it seems to consider the pattern only). If you or anyone else that works on this project is too busy I can try adding a rule for this, or is there any special reasons as to why empty strings are not allowed?

PS: Let me know if this is not the right channel to report this.

If you remove the node entirely, the themes can adjust for that. For example, the Stackoverlow theme will show that as Current if there is no endDate node.

@iamkarlson
Copy link

Using chrome extension for Linkeding I'm getting this error even if I removed endDate. Is there a way to debug it?

@duke7able
Copy link

For now i think i have bypassed the endDate issue , not sure will it work or not, but not giving error there now, though i am getting error ahead.
for end date i did is : (new Date()).toString() See if it helps

@duke7able
Copy link

@thomasdavis currently getting error,
Resume json invalid - [{"code":"INVALID_TYPE","params":["object","string"],"message":"Expected type object but found type string","path":"#/","title":"Resume Schema"}] - Please visit #27

Note : I am generating this from linkedin using the extension with stable or default config. I had to change few nulls and date as above, that errors have been bypassed, I got this one. I tried to debug I figured that the issue is with the $schema link, which has this url : https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json and in it the title key is there which has value "Resume Schema". Now not sure why it requires object and why here string is provided

@duke7able
Copy link

In the above object, there is again $schema variable which has another json link, I also checked that. in it there is only 1 title field whose value is string.
image

@duke7able
Copy link

i took that json, installed resume-cli locally, replaced basic resume.json that gets created after resume init command with this json. It gives error when resume validate is called. Here the warning logs :-
(node:868) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ( in JSON at position 1945
at JSON.parse ()
at application/json (/usr/local/lib/node_modules/resume-cli/build/get-resume.js:30:38)
at _default (/usr/local/lib/node_modules/resume-cli/build/get-resume.js:63:10)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an
async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:868) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@duke7able
Copy link

the issue was some how with this (new Date()).toString() since after i remove that section it started to work

@argandas
Copy link

argandas commented Jan 14, 2023

When using the JSON resume exporter tool in my LinkedIn profile, I got the JSON file with an empty "endDate" field for my current job position, and this caused an error in the JSON resume registry.

Example Input:

{
  "work": [
    {
      "name": "Company Name",
      "position": "Ninja",
      "startDate": "2022-05-31",
      "endDate": "",
    }
  ]
}

JSON resume registry message:

Resume json invalid - [{"code":"PATTERN","params":["^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$",""],"message":"String does not match pattern ^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$: ","path":"#/work/0/endDate","description":"e.g. 2014-06-29"}] - Please visit https://github.com/jsonresume/registry-functions/issues/27

The workaround, for now, is just to remove that line and then it works.

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

No branches or pull requests

7 participants