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

[Schema] TypeScript to JSON Schema #786

Closed
kjdelisle opened this issue Dec 7, 2017 · 1 comment
Closed

[Schema] TypeScript to JSON Schema #786

kjdelisle opened this issue Dec 7, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@kjdelisle
Copy link
Contributor

kjdelisle commented Dec 7, 2017

Story

As a LB4 dev, I want my TypeScript classes to be automatically converted into JSON Schema so that I have a metadata representation of my classes that I can freely convert into other formats (OpenAPI schema, other classes in other languages, etc)

Cross-posting from #700:

In our Todo model example, we are duplicating information about model properties - first time in Model definition, second time in Swagger (OpenAPI) Schema.

We should have a helper function that can create Swagger/OpenAPI Schema from the Model data.

Acceptance Criteria

  • Create a metadata type system (yikes!) that leverages the existing decorator names (@model, @property)
  • For @property:
    • Introspect the type of the property, either as a primitive type, or otherwise
      • For complex types, mark with $ref (we can dereference this later)
  • For @model:
    • Add top-level specific metadata to the entry for this type:
      • description
      • title
      • required
      • oneOf (it's a union type!) not supported by current juggler implementation
  • Write a blog post about how awesome this will be (unless it's not, then don't ;) )
  • Document on loopback.io
@shimks shimks added team-apex and removed epic labels Dec 7, 2017
@shimks shimks self-assigned this Dec 11, 2017
@bajtos bajtos added the p1 label Dec 12, 2017
@kjdelisle kjdelisle added this to the Sprint 51 milestone Dec 12, 2017
@bajtos bajtos mentioned this issue Dec 12, 2017
10 tasks
@kjdelisle kjdelisle self-assigned this Dec 20, 2017
@b-admike b-admike modified the milestones: Sprint 51, Sprint 52 Dec 27, 2017
@dhmlau dhmlau modified the milestones: Sprint 52, Sprint 53 Jan 9, 2018
@kjdelisle kjdelisle modified the milestones: Sprint 53, Sprint 54 Jan 23, 2018
@kjdelisle kjdelisle modified the milestones: Sprint 54, February 2018 Jan 30, 2018
@kjdelisle
Copy link
Contributor Author

@shimks How close are we to landing this? If the blog post has been approved for technical merit and is just in a holding pattern for grammar/touching up, then we can safely close this task.

@shimks shimks closed this as completed Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants