forked from sinatahoori/JsonResumeSharp
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using NodaTime; | ||
using NodaTime.Serialization.JsonNet; | ||
|
||
namespace ResumeSharpLib | ||
{ | ||
|
||
/// <summary> | ||
/// The JsonJob object based on https://jsonresume.org/job-description-schema/ | ||
/// </summary> | ||
public partial class JsonJob | ||
{ | ||
[JsonProperty("title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty("company")] | ||
public string Company { get; set; } | ||
|
||
[JsonProperty("type")] | ||
public string Type { get; set; } | ||
|
||
[JsonProperty("date")] | ||
public OffsetDateTime Date { get; set; } | ||
|
||
[JsonProperty("description")] | ||
public string Description { get; set; } | ||
|
||
[JsonProperty("location")] | ||
public string Location { get; set; } | ||
|
||
[JsonProperty("remote")] | ||
public string Remote { get; set; } | ||
|
||
[JsonProperty("salary")] | ||
public string Salary { get; set; } | ||
|
||
[JsonProperty("experience")] | ||
public string Experience { get; set; } | ||
|
||
[JsonProperty("responsibilities")] | ||
public List<string> Responsibilities { get; set; } | ||
|
||
[JsonProperty("qualification")] | ||
public List<string> Qualifications { get; set; } | ||
|
||
[JsonProperty("skills")] | ||
public List<Skill> Skills { get; set; } | ||
|
||
} | ||
|
||
|
||
public partial class JsonJob | ||
{ | ||
/// <summary> | ||
/// Create a JsonResume object from json string | ||
/// </summary> | ||
/// <param name="json">the json string</param> | ||
/// <returns></returns> | ||
public static JsonJob FromJson(string json) => JsonConvert.DeserializeObject<JsonJob>(json, Converter.Settings); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using ResumeSharpLib.Utils; | ||
|
||
namespace ResumeSharpLib.Utils.Extensions | ||
{ | ||
public static class JsonJobExtensions | ||
{ | ||
/// <summary> | ||
/// Adds a skill item to the job object | ||
/// </summary> | ||
/// <param name="jsonJob">the job object</param> | ||
/// <param name="skill">the skill item</param> | ||
/// <returns></returns> | ||
public static JsonJob AddSkill(this JsonJob jsonJob, Skill skill) | ||
{ | ||
Utilities.AddItemToList(jsonJob.Skills, skill); | ||
return jsonJob; | ||
} | ||
|
||
public static JsonJob AddQualification(this JsonJob jsonJob, string qualification) | ||
{ | ||
Utilities.AddItemToList(jsonJob.Qualifications, qualification); | ||
return jsonJob; | ||
} | ||
|
||
public static JsonJob AddResponsibility(this JsonJob jsonJob, string responsibility) | ||
{ | ||
Utilities.AddItemToList(jsonJob.Responsibilities, responsibility); | ||
return jsonJob; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters