func paths(g *gen.Graph, s *spec.Spec) error {
	for _, n := range g.Nodes {
		// Add schema operations.
		ops, err := nodeOperations(n)
		if err != nil {
			return err
		}
		// root for all operations on this node.
		root := "/" + rules.Pluralize(strcase.KebabCase(n.Name))
		// Create operation.
		if contains(ops, opCreate) {
			path(s, root).Post, err = createOp(s, n)
			if err != nil {
				return err
			}

		}
		// Read operation.
		if contains(ops, opRead) {
			path(s, root+"/{id}").Get, err = readOp(s, n)
			if err != nil {
				return err
			}
		}
		// Update operation.
		if contains(ops, opUpdate) {
			path(s, root+"/{id}").Patch, err = updateOp(s, n)
			if err != nil {
				return err
			}
		}
		// Delete operation.
		if contains(ops, opDelete) {
			path(s, root+"/{id}").Delete, err = deleteOp(s, n)
			if err != nil {
				return err
			}
		}
		// List operation.
		if contains(ops, opList) {
			path(s, root).Get, err = listOp(s, n)
			if err != nil {
				return err
			}
		}
		// Sub-Resource operations.
		es, err := filterEdges(n)
		if err != nil {
			return err
		}
		for _, e := range es {
			p := path(s, root+"/{id}/"+strcase.KebabCase(e.Name))
			if e.Unique {
				p.Get, err = readEdgeOp(s, n, e)
				if err != nil {
					return err
				}
			} else {
				p.Get, err = listEdgeOp(s, n, e)
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
// paths adds all views to the specs schemas.
paths adds all views to the specs schemas.
// paths adds all views to the specs schemas .
func paths(g *gen.Graph, s *spec.Spec) error {
	for _, n := range g.Nodes {
		ops, err := nodeOperations(n)
		if err != nil {
			return err
		}
		root := "/" + rules.Pluralize(strcase.KebabCase(n.Name))
		if contains(ops, opCreate) {
			path(s, root).Post, err = createOp(s, n)
			if err != nil {
				return err
			}
		}
		if contains(ops, opRead) {
			path(s, root+"/{id}").Get, err = readOp(s, n)
			if err != nil {
				return err
			}
		}
		if contains(ops, opUpdate) {
			path(s, root+"/{id}").Patch, err = updateOp(s, n)
			if err != nil {
				return err
			}
		}
		if contains(ops, opDelete) {
			path(s, root+"/{id}").Delete, err = deleteOp(s, n)
			if err != nil {
				return err
			}
		}
		if contains(ops, opList) {
			path(s, root).Get, err = listOp(s, n)
			if err != nil {
				return err
			}
		}
		es, err := filterEdges(n)
		if err != nil {
			return err
		}
		for _, e := range es {
			p := path(s, root+"/{id}/"+strcase.KebabCase(e.Name))
			if e.Unique {
				p.Get, err = readEdgeOp(s, n, e)
				if err != nil {
					return err
				}
			} else {
				p.Get, err = listEdgeOp(s, n, e)
				if err != nil {
					return err
				}
			}
		}
	}
	return nil
}
func paths ( g * gen . Graph , s * spec . Spec ) error { for _ , n := range g . Nodes { ops , err := nodeOperations ( n ) if err != nil { return err } root := " " + rules . Pluralize ( strcase . KebabCase ( n . Name ) ) if contains ( ops , opCreate ) { path ( s , root ) . Post , err = createOp ( s , n ) if err != nil { return err } } if contains ( ops , opRead ) { path ( s , root + " " ) . Get , err = readOp ( s , n ) if err != nil { return err } } if contains ( ops , opUpdate ) { path ( s , root + " " ) . Patch , err = updateOp ( s , n ) if err != nil { return err } } if contains ( ops , opDelete ) { path ( s , root + " " ) . Delete , err = deleteOp ( s , n ) if err != nil { return err } } if contains ( ops , opList ) { path ( s , root ) . Get , err = listOp ( s , n ) if err != nil { return err } } es , err := filterEdges ( n ) if err != nil { return err } for _ , e := range es { p := path ( s , root + " " + strcase . KebabCase ( e . Name ) ) if e . Unique { p . Get , err = readEdgeOp ( s , n , e ) if err != nil { return err } } else { p . Get , err = listEdgeOp ( s , n , e ) if err != nil { return err } } } } return nil }
paths adds all views to the specs schemas.
paths adds all views to the specs schemas .
// Add schema operations. // root for all operations on this node. // Create operation. // Read operation. // Update operation. // Delete operation. // List operation. // Sub-Resource operations.